Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

[Deliver skeleton] Sidebar customization

Started by Sandra 8 years ago · 0 replies · 408 views
8 years ago

Hi everyone,
I'm playing with the Deliver theme installed as skeleton, and bumped into a (hopefully silly) problem. I want to customize the blocks in the sidebar.html.twig file based on the category of the page.
So for my blog category, all the defaults are great and want them there. But for other collections like one called Facilities (which I created replicating the Archive page), I want this block to show and not the others:

TWIG
    {% if config.plugins.taxonomylist.enabled %}
<div class="sidebar-content">
    <h4>Facilities</h4>
    <ul>
       {% for post in taxonomy.findTaxonomy({'category':'facilities'}) %}
         <li><a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></li>
       {% endfor %}
    </ul>
</div>
{% endif %}

I should be adding something of the sort of "and taxonomy.category == 'facilities' " to my if-sentence. But I can't figure out the exact syntax to make it work.

If someone can lead me to the answer I would highly appreciate it. With this solved the hide-and-seek situation is resolved for all the blocks (hopefully) and the sidebar becomes fully customizable.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 198 2 months ago
Themes & Styling · by Ian, 2 months ago
3 94 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 456 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 48 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 128 3 months ago