I have a question regarding the new recipe for placeholders in Kirbytext (Placeholders | Kirby CMS).
I would like to use some logic in kirbytext and was wondering, if i could create a placeholder in the template like this:
I would then declare $subpages as an html string: <a href="http://www.url.com">Subpage 1</a>, <a href="http://www.url.com">Subpage 2</a>
through a foreach loop.
Now my 2 questions:
is it possible to include a variable into the function above (the one that includes the placeholders)
&
how can i write a string from a foreachloop so i can create this html to be a placeholder?
additional question: is there maybe already a simpler way to have this kind of logic in kirbytext? how can i call the subpages of a page through kirbytext?
Wow! works like a charm. As always: thanks a lot!!!
And just like this, we introduced logic into the kirbytext
One last tiny question though: I would like to create sentences such as: We are offering subpage, subpage, subpage, and subpage.
How could i inject the “and” before the last item of the subpages? usually i ask in a foreach loop for the last item and include it there. but in your example i wouldn’t know how to add exceptions…