I’m currently using the same method the starter kit uses to add the gallery to to a textarea. For example, {{ gallery }}. But I’m using it to add a form to a page with {{ form }}. Until today it’s worked pretty well. My only issue is now I’m checking for some values and skipping areas if the value is empty which seems to leave blank areas which are triggering <pre> tags so I get this…
And what in that snippet did you add that caused it to break, the hook logic stuff? I’d put that at the top of the file anyway, better yet into a function or page method/model.
I’d test if it is one of the block snippets or the main form that is causing the issue first, by uncommenting the snippet call first and adding or removing parts of the main form.
I think the problem is that you used the kirbytags:after hook. Markdown is parsed after it. The empty line and indentation make it think it’s a code block. Try using the kirbytext:after hook.
It’s just my guess. I haven’t used these hooks before.
Ok, If I try kirbytext:after I don’t get access to the $data parameter, only $text. How am I able to get the form from there to replace the {{ form }} tag?
If I load the snippet without the “true” paramater, the album gets rendered - but above the kirbytext and when I reduce the indentation to two spaces it actually works, but it makes my code hard to read.
Are You still thinking about changing this?
I was referring to the code in the getkirby.com website.
The problem is the markdown parser that causes some issues in some place. I completely agree that snippets with no indents are completely annoying, and if you usually use four spaces, then having to use two spaces for these snippets is also a pain in the neck.
Ok, thanks for the explanation.
I think I can live with it. Just have to remind myself, when sth is not working as expected.
Took me quite a while to figure out what the problem in this case was