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

Identify a category: page

Started by Muut Archive 10 years ago · 2 replies · 406 views
10 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

10 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 1352 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4064 9 years ago
Archive · by Muut Archive, 9 years ago
1 2949 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago