grav-theme-future2021/templates/modular.html.twig
pmoreno.rodriguez efc22e2780
Improved the definition of variables.
Improved the definition of title, subtitle and image variables.
Code commented about showing one page menu on modular pages. Pending future improvement
2023-02-03 22:42:55 +01:00

45 lines
1.1 KiB
Twig

{% extends 'partials/base.html.twig' %}
{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %}
{% set title = page.title|raw %}
{% set subtitle = page.header.subtitle|raw %}
{# Commented code for future improvements in modular menu #}
{# {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}
{% macro pageLinkName(text) %}
{{ text|lower|replace({' ':'_'}) }}
{% endmacro %} #}
{% block menu %}
{% include 'partials/sidebar_right.html.twig' %}
{% endblock %}
{% block content %}
<article class="post">
<header>
<div class="title">
<h2>{{ title }}</h2>
{% if subtitle %}
<p>{{ subtitle }}</p>
{% endif %}
</div>
</header>
{% if image %}
{{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }}
{% endif %}
{{ page.content|raw}}
{% for module in page.collection() %}
{{ module.content|raw }}
{% endfor %}
</article>
{% endblock %}
{% block sidebar %}
{% if theme_config.sidebar == true %}
{% include 'partials/sidebar_left.html.twig' %}
{% endif %}
{% endblock %}