Closed fabrizioT closed 7 years ago
Nevermind. Getter should be explicitly called and the plugin will work straight out-of-the-box.
Found a working example here: [removed for spam link]
`{% set taxlist = taxonomylist.get() %} {% if taxlist %} {% for tax,value in taxlist['category'] %}
{% endfor %}
{% endif %}`
The link above goes to a SPAM site. It should be removed immediately.
I'm not sure who is best to contact for this, so I'm just adding @rhukster and @mahagr since I see you guys as most active in the repo.
The link above goes to a SPAM site. It should be removed immediately.
That's true, however I did manage to find original content on Wayback Machine : https://web.archive.org/web/20180207164318/http://diblas.net/blog/add-the-posts-categories-to-the-blog-navigation-menu-powered-by-grav-cms#
removed the spam link
I've spent some time in figuring how to get this working, as no example was given ... Unless i'm wrong i guess you are supposed to traverse the taxonomy list from Twig via some code like:
{% for name,count in taxonomylist.category %} taxonomy name:{{name}} - number of posts:({{count}}) {% endfor %}
However i was unable to get the list populated. I do think function onTwigSiteVariables() within taxonomylist.php is broken / uncomplete.
Seems to me it simply lacks the proper getter call, so generated list is always empty. The plugin works when i add this (ugly) call at the bottom of onTwigSiteVariables() function:
$twig->twig_vars['taxonomylist'] = $twig->twig_vars['taxonomylist']->get();
I stand corrected.