What is the best way, to provide different global content “snippets” to editors?
These layout of these content snippets are very different - dnd areas are required, where the editor can create whatever layout needed. These content snippets should be useable in different pages, and provide the possibility to be editable “globally” like any other global content.
Section templates sound useful, but do not have a global option.
If you have HubDB, you could use it for your snippets.
Create custom modules and put the HubDB infprmation there. Once done you could set up a dropdown or even a text(not rich-text) field to “search” your HubDB and provide the content based on dropdown option/text input.
Another option which would be possible but is not that “userfriendly” since your users/marketers will need access to the design-tools is setting up a file with all of your content and use the variables in the templates/modules
E.g:
{# simple HTML file somewhere in your theme #}
<!--
templateType: "none"
isAvailableForNewContent: false
-->
{% set headline_A = "Lorem ipsum" %}
{% set image_A_path = "loremipsum.com/path-to-image.png" %}
{% set headline_B = "Lorem ipsum dolor" %}
{% set image_B_path = "loremipsumdolor.com/path-to-image.png" %}
...
Make sure to include this file in the templates you’d like to provide those variables. If you want to make them available in every template import it in the base.html/layout.html file
in elements like the rich-text (put them in the source-code view)
Another option would be to create a (global) module with all of your options and put it with export_to_template_context into the template(s) and grab the info through other modules.
Yes, I’ve read your question. Based on your request it’s quite hard to provide a more precise answer. If you could provide a more detailed usecase I’ll be happy to provide more detailed possible solutions.
Also: Those were simple examples but you could do that with dnd areas as well.
Option A:
Put your dnd_area layout into a rich-text element of a HubDB and provide a select option in a module.
Option B:
Put your dnd_area layout into a html file and import it in the template
Option C:
Write your dnd_areas in one file wrapped in an if-elif-endif statemenet and show/hide them based on a module setting with export_to_template_context.