getgrav / grav-plugin-taxonomylist

Grav TaxonomyList Plugin
https://getgrav.org
MIT License
25 stars 14 forks source link

Filter By Category #9

Open daz3dpr0z opened 8 years ago

daz3dpr0z commented 8 years ago

I have a project which has 2 blog pages.

I want to be able to filter the tag cloud so it contains just the categories relevent to the current blog page as opposed to pulling in all the tags for the site .

The problem with pulling in all the tags from the whole site is if a user clicks on a tag which is not part of the current directory tree it results in a 0 listing which would not look well on a production site and could result in a visitor getting bored and not exploring the site any further.

Thanks in advance

jimmy

drinkharder commented 7 years ago

Are you referring to have a list of categories and their counts on sidebar? I want to know how to do this also.

beamaria commented 4 years ago

Same issue here..Any solution??

ToeiRei commented 2 years ago

I'd suggest something like

<h4>Categories</h4>
<span class="categories">
        {% for tax,value in taxlist['category'] %}
        <li> <a href="{{ base_url }}/category{{ config.system.param_sep }}{{ tax|e('url') }}">{{ tax|capitalize }}</a></li>
        {% endfor %}
</span>