pmoreno-rodriguez / grav-theme-editorial

Editorial is a GravCMS port of the Editorial theme from HTML5Up.net.
https://editorial.pmdesign.dev
Other
15 stars 4 forks source link

Incompatibility with Twig Extensions #39

Closed Fazarel closed 10 months ago

Fazarel commented 10 months ago

The latest version of the Twig Extensions plugin is incompatible with the theme. After updating the plugin, an error message appears:

Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Undefined variable $customDateFormat")."

Seems related to editorial/templates/partials/page-bits/date.html.twig

{% elseif config.plugins["twig-extensions"].enabled %}
    {% set datestamp = (page.header.publish_date) ? (page.header.publish_date|localizeddate('medium', 'none', lang)) : (page.date ? page.date|localizeddate('medium', 'none', lang) : page.modified|localizeddate('medium', 'none', lang)) %}
pmoreno-rodriguez commented 10 months ago

Hi @Fazarel , this issue is related with this one. This issue is not an issue with the Editorial theme, but with the recently updated Twig Extensions plugin. While the plugin author releases another working version, you can adjust your plugin code. I have to do some more tests to verify if I need to change the theme code in another way.

bitstarr commented 10 months ago

With the latest release of the twig-extensions plugin the problem should be gone. Sorry for the inconvenience.

pmoreno-rodriguez commented 10 months ago

Thanks @bitstarr. I will close this issue.