Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

[Deliver skeleton] Sidebar customization

Started by Sandra 8 years ago · 0 replies · 689 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 MarkP, 2 weeks ago
3 193 2 weeks ago
Themes & Styling · by TomW, 2 weeks ago
0 111 2 weeks ago
Themes & Styling · by themetman, 3 weeks ago
1 206 3 weeks ago
Themes & Styling · by AH, 1 month ago
1 324 3 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1523 3 weeks ago