Hi,
I looked in the ‘Pinpress’ and ‘Striped’ skeletons which gave me some hints, but it didn’t help to finally solve my problem, an earlier thread here in the forum didn’t help either.
I have a modular page ‘Home’ with a child ‘Sidebar’, which gives me this folder structure:
/user
/pages
/01.home
/01.sidebar
/_module1
/_module2
...
The template attributed to ‘Home’ is templates/modular.html.twig (extends partials/base.html.twig).
The parent of Sidebar is ‘——▸ (home) Home’, and the modular part works well, but not the sidebar.
My partials/base.html.twig looks like this:
{% block body %}
<main id="content" class="Site-content">
{% block content %}{% endblock %}
</main><!-- /.Site-content -->
{% endblock %}
{% block sidebar %}
{% include 'partials/sidebar.html.twig' %}
{% endblock %}
My first problem:
The selection of templates offered for ‘sidebar’ in the Admin GUI are all under /templates, not under /partials, i.e. I can’t attribute partials/sidebar to my sidebar page.
Second problem:
‘Home’ is not the only page with a sidebar, some of them non-modular, and all those sidebars shall have individual, via the Admin GUI editable content. That means that there are children named ‘sidebar’ for more than one page, so the sidebar.html.twig shall have a universal construct like
{{ page.children.find('/sidebar').content }}
to work for all sidebars to access the content.
But anyway, the above approach doesn’t work for me. Maybe because of problem one?
How can I find the correct content??
And: If I want to set some parameters for the sidebar in the page header (Frontmatter), where do I have to put it, in the sidebar page or in the parent?
BTW: I searched without success, but where could I find a list with explanations for all the nominations for objects like ‘page.children…’ etc?
Thanks for any help.
Harald