I think this is what I am looking for to embed a little link menu for social media, displayed with Font Awesome icons, like this
(snippet: social)
I have a simple blueprint with a title and a textarea. What happens with the snippet tag is that the content of the snippet does not appear in the middle of the textarea where I placed it - it appears on top of it, below the heading that was created by the title field. Do I misunderstand the way the tag works?
Ooops: what I get now is the raw code, as if the code is wrapped in pre-tags… Hm. Is it possible that it has to do with my PHP version? The provider is still on PHP 5.3, so I use Kirby 2.1.
It seems like anything after the custom tag does not get parsed as markdown? For example…
## Some Header
Some paragraph of text.
(snippet: list-team)
And this is the last sentence in the textarea.
In the above case when I output this with kt() it does not wrap the final sentence with p tags. Everything above the snippet embed tag gets converted from markdown/kt to html.
Thanks for the reply. I’m working with version 2.57.
It’s definitely something with the snippet file itself. I narrowed it down and see that this behavior is due to the use of the kt() or kirbytext() in the snippet file that gets embedded.
Do you mean, due to using kt() within your snippet? For obvious reasons, I can’t test your snippet, at least not without having to recreate your structure, but if I create a simple snippet like this:
<div><?= $page->intro()->kt() ?></div>
and insert it via the snippet tag in the home page of a Starterkit, it works fine.
Hmmm… Right. When I remove all code from my snippet and simply use the following…
<?php #$site->title()->kt() ?>
Everything seems fine. I don’t know. Maybe it has to do with it cycling through through the structure object with the foreach loop. Don’t see why though.
@texnixe Is there something further that one needs to do to make the V3 plug-in above (dynamic snipped names) besides install it to the plug-in folder? Despite installation (plugins>custom-tags>custom-tags.php), my snippet tags are not replaced.
Example:
Version: (snippet: version-snippet)
… where version-snippet.php is in the snippets folder.
Even after installing the plug-in, this is rendered on the live HTML page as: