gantry5
gantry5 copied to clipboard
Gantry5 and Grav: the custom HTML particle no longer processes twig
Hi. I have a problem since updating my local Grav website to Gantry 5.5: the "Custom HTML" particle no longer processes twig. I used this code to display the related posts in sidebar:
<h2>RelatedPosts</h2>
<ul class="related-pages">
{% for related_path, score in related_pages %}
{% set related = grav['pages'].get(related_path) %}
{% if related %}
<li>
{% if config.plugins.relatedpages.show_score %}
<span class="score">{{ score }}</span>
{% endif %}
<a href="{{ related.url }}" title="{{ related.title }}">{{ related.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
After ticking the "process twig option" (see attachment2) the titles of all the related articles were displayed correctly, now all I can see is the title between h2 tag (see attachment1)
Settings: Grav 1.7.29.1 Admin Panel 1.10.29 Gantry plugin 5.5.9


I just tested this, and twig works just fine. I don't think related_pages
is set, particles do not see variables set outside their scope.
The related Pages Plugin is really difficult to configure... Basically I have the situation in the attachment. I have tried with every possible combination , but still I cannot have it working properly...Maybe the problem is given by having only one "Blog Layout" for all the articles, irrespectively from their category...
