pmoreno-rodriguez / grav-theme-editorial

Editorial is a GravCMS port of the Editorial theme from HTML5Up.net.
Other
13 stars 2 forks source link

Popular tags in sidebar: missing blog route in buttons link when outside the blog #37

Closed Fazarel closed 7 months ago

Fazarel commented 7 months ago

The button link doesn't work: it takes you back to the home page. The links work when consulting the blog or an article, but not on other pages: the blog route should be added to the link for all pages other than the blog or articles.

Confirmed in demo site.

Maybe something to modify in partials/sidebar.html.twig {% set new_base_url = blog.url == '/' ? '' : blog.url %} or in partials/taxonomylist.html.twig ?

pmoreno-rodriguez commented 7 months ago

You are right. I will fix it as soon as possible. Thanks so much.

Fazarel commented 7 months ago

If I may make a suggestion in passing: I'm not sure it's relevant to list the "featured" tag, since the publications are already displayed above with a "more featured posts" button. Unfortunately I don't see an option in the Taxonomy List plugin to easily exclude tags from the list...

pmoreno-rodriguez commented 7 months ago

The button link doesn't work: it takes you back to the home page. The links work when consulting the blog or an article, but not on other pages: the blog route should be added to the link for all pages other than the blog or articles.

Confirmed in demo site.

Maybe something to modify in partials/sidebar.html.twig {% set new_base_url = blog.url == '/' ? '' : blog.url %} or in partials/taxonomylist.html.twig ?

Finally, after some testing, the problem was caused by inheritance between Twig templates. The sidebar template is inserted from base.html.twig, so I have inserted the line corresponding to the blog path in that file.

The origin of the problem was that within the sidebar, a reference was made to blog.url, which was not defined, outside the scope of the blog page.

Can you confirm that it works on the demo page?

Fazarel commented 7 months ago

It seems to work fine now! Thank you!

pmoreno-rodriguez commented 7 months ago

Fixed in 2.0.5 release