How to pass php variables to pages (not to the templates)

Hi there,
this is probably an easy question, but I can’t get the answer:

I understand that you can use <?php somephpcode ?> on the template level.
But how do I get infomation, normally easily accessed via php to the page level?

To clarify, I mean by pages, what you would write in Markdown.

In my speciffic case, I want to use icons, stored in mysite.com/assets/images/myicondir/
I don’t want to hardcode the path to the dir.

I also tried to use relative path to an icon directory as a sub directory of the page. That does not seem to work as the url is modified by apache/htaccess

Thanks for your help in advance.

You can link to an image in your markdown fields like this:

(image: /assets/images/icons/logo.svg)

The link to the image is then automatically converted to an absolute url.

And if you need a more flexible or custom solution, you can extend Kirbytext with your own Kirbytags and filters, which will basically run your custom PHP code on the Markdown content.

thanks lukasbestle and texnixe,
here is the result: http://hydrosight.de/de/company

with the following page text:

`


(image: /assets/images/grundsaetze-icons/green_power.svg)
Hydrosight nutzt Grünen Strom: Fertigung, Büro und Server werden größtenteils aus erneuerbaren Energien bedient.
`

it is a bit unusual mixing markdown and html, but not using php. once you get used to it it makes sense.

It’s no problem to use HTML in your markdown. Having said that, you would be more flexible with a structure field for that purpose and would also separate content from display that way.