getgrav / grav-plugin-taxonomylist

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

Problem with base_url for taxonomy #21

Closed TuntematonSotilas closed 6 years ago

TuntematonSotilas commented 6 years ago

Hello,

I have a problem with the base_url for taxonomy :

My tags created with the admin interface are well shown on my blog page (https://gatobael.frama.site/)

But the links have no base url :

<a class="btn btn-primary" href="//tag:SF">SF</a>

paulmassen commented 6 years ago

Had this problem too and had to customize the partials.

I wonder why we do not use the value from the config in the example from the readme:

For now, it is like this: {% include 'partials/taxonomylist.html.twig' with {base_url: my_url, taxonomy: 'tag'} %} Whereas we could write something like

{% include 'partials/taxonomylist.html.twig' with {base_url: base_url ~ config.plugins.taxonomylist.route, taxonomy: 'tag'} %}

base_url is concatenated with route from config in case the site runs under a subfolder.

TuntematonSotilas commented 6 years ago

Thanks but I don't have access html (or twig) files , I have only access to the admin plugin (https://github.com/getgrav/grav-plugin-admin). Does it exists another solution ?

kenton-r commented 6 years ago

The above solution works. And in my situation of multiple "blogs" or collection pages, I inserted into the frontmatter a value and then referenced it with the following: {% include 'partials/taxonomylist.html.twig' with {base_url: base_url ~ page.header.taxonomy.route, 'taxonomy':'tag', children_only: true} %}

Edit: or you can use the current page with: {% include 'partials/taxonomylist.html.twig' with {base_url: base_url ~ page.url, 'taxonomy':'tag', children_only: true} %}

TuntematonSotilas commented 6 years ago

Problem solved for me (by the admin guy of my grav) He sets the parameter absolute_urls to true.