Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Identify a category: page

Started by Muut Archive 11 years ago · 2 replies · 475 views
11 years ago

Hello! I've been playing around with the Bootstrap template achieving almost everything I need for my first custom Grav template quite easily. I only have one open question I haven't solved yet and I didn't find an answer here in the forum.

I made a little javascript function to run a category-menu which filters the posts displayed in the blog.html.twig page base on their categories, but I'd like to hide it when this page is a category: one, since the displayed posts are all from the same category.

Thanks in advance.
Greetings from Italy!

PS: I attach a screen shot, where the category-menu to be hidden is the one wrapped in the purple line. Screen Shot

11 years ago

It worked perfectly:

TWIG
{% if uri.param('category') != '' %}
   <h1>Posts in the {{ uri.param('category') }} section.</h1>
{% else %}    
   //category filter menu
{% endif %}

Thanks a lot!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2288 9 years ago
Archive · by Muut Archive, 9 years ago
2 1500 9 years ago
Archive · by Muut Archive, 9 years ago
2 4753 9 years ago
Archive · by Muut Archive, 9 years ago
1 3569 9 years ago
Archive · by Muut Archive, 9 years ago
3 1626 9 years ago