You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, it took me a while to realize that for SimpleSearch and Archives to work properly the default category for each blog post has to be "blog".
Now the reason I'm writing this issue is, that the related pages are displayed by category instead of tag by default in this theme. The RelatedPages Plugin uses Tag for relations by default as well.
This is the code I'm using now:
{% if related.taxonomy.tag %}
<p class="jp-relatedposts-post-context">
{% set related_tags = array_intersect(related.taxonomy.tag, page.taxonomy.tag) %}
{% if related_tags %}
Shares Tag
{% for tag in related_tags %}
{% if tag %}
"{{ tag|capitalize }}" {% if not loop.last %}, {% endif %}
{% endif %}
{% endfor %}
{% endif %}
</p>
{% endif %}
Hi, it took me a while to realize that for SimpleSearch and Archives to work properly the default category for each blog post has to be "blog".
Now the reason I'm writing this issue is, that the related pages are displayed by category instead of tag by default in this theme. The RelatedPages Plugin uses Tag for relations by default as well.
This is the code I'm using now:
See https://github.com/getgrav/grav-theme-gateway/blob/develop/templates/partials/relatedpages.html.twig#L16 for comparison
Edit: Updated code so it only shows tags that are shared between blog post and related post
The text was updated successfully, but these errors were encountered: