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

Taxonomy plugin: links of tag cloud point to homepage

Started by Muut Archive 10 years ago · 1 replies · 545 views
10 years ago

Hi guys,

I use the pinpress theme for my site (http://demo.getgrav.org/pinpress-skeleton/) and have the taxonomy plugin enabled.

When I read my blog article and click on a tag it points to the correct URL (mysite.com/blog/tag:example).
ALL links that are generated in the tagcloud look like this: mysite.com/tag:example. The blog as subfolder is missing.

What can I do to get the right links?

user/config/plugins/taxonomylist.yaml
enabled: true
route: /blog

user/themes/pinpress/templates/partials/sitebar.html.twig
{% if config.plugins.taxonomylist.enabled %}
<div class="widget HTML">
<h2 class="title">Tags</h2>
<div class="widget-content">
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
</div>
</div>
{% endif %}

Thanks!

10 years ago

I found a solution:

IN: /user/themes/pinpress/templates/partials/taxonomylist.html.twig
I just added "/blog"

Now the file looks like this:
{% set taxlist = taxonomylist.get() %}

{% if taxlist %}
<div class="widget-content list-label-widget-content">
<ul>
{% for tax,value in taxlist[taxonomy]|slice(0, 5) %}
<li>
{% set active = uri.param(taxonomy) == tax ? 'active' : '' %}
<a class="{{ active }}" href="{{ base_url_absolute }}/blog/{{ taxonomy }},{{ config.system.param_sep }},{{ tax|e('url') }}">{{ tax }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1366 9 years ago
Archive · by Muut Archive, 9 years ago
2 940 9 years ago
Archive · by Muut Archive, 9 years ago
2 4069 9 years ago
Archive · by Muut Archive, 9 years ago
1 2960 9 years ago
Archive · by Muut Archive, 9 years ago
3 1124 9 years ago