mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-07-03 00:28:55 +00:00
Improved the definition of title, subtitle and image variables. Code commented about showing one page menu on modular pages. Pending future improvement
45 lines
1.1 KiB
Twig
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 %}
|