Easily maintain snippets in panel (not via blocks?)

Good evening,

I have read about Blocks for Blueprints which all sounds amazing. But overkill.

I need a simple way to edit the content of a handful of snippets via the Panel.

When searching the forum, I get lots of results of snippets for blueprints - but I want it the other way around! :smiley:

So I checked all Blueprint Fields in the doc (before I embarrasingly get this hint from Sonja again g) and there is none. Also, the whole template-name <> blueprint name thing does not work out with snippets.

Unless they are not stored in site/blueprints/pages but in site/blueprints/snippets! Which they are not of course, there is no such Blueprint type: Introduction | Kirby CMS (getkirby.com)

So again my obvious question: how do I solve this?

Thanks
Andreas

Hm, I don’t really understand your problem/question. Maybe you can explain it from a use case perspective of what you want to achieve.

The (main) purpose of snippets is to keep your templates clean, by moving parts of your code out of the way, particularly those parts that are likely to be reused across templates (typical examples are the header and footer, but also stuff like the navigation, code snippets that are used within loops etc.).

And since the smallest content unit in Kirby is a page, there is no such thing as blueprints for snippets, unless you work with blocks or with subpages as modules of a page (in which case we are back to page blueprints).

I am using snippets to re-use parts of the layout in different templates like a specific button with a call to action. Obviously, there is text within the snippets which needs to be maintained and also translated.

So I thought I could create an area within the panel where I just manage the content and translations of these snippets.

Until it came to me: this place already exists, with the site blueprint! The answer is quite obvious: since these snippets can be used on the whole site (with the same text) there was only one place to store all the texts: in site.en.txt. Which means the obvious solution is to add a section/tab/whatever for the site.yml to manage these texts.

Thanks!
Andreas

Exactly!

1 Like