mirror of
https://github.com/pmoreno-rodriguez/grav-theme-future2021.git
synced 2025-06-07 20:08:54 +00:00
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
This commit is contained in:
parent
08e1b28e46
commit
efc22e2780
1 changed files with 16 additions and 7 deletions
|
@ -1,9 +1,15 @@
|
|||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %}
|
||||
{% 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 %}
|
||||
{% endmacro %} #}
|
||||
|
||||
{% block menu %}
|
||||
{% include 'partials/sidebar_right.html.twig' %}
|
||||
|
@ -13,16 +19,19 @@
|
|||
<article class="post">
|
||||
<header>
|
||||
<div class="title">
|
||||
<h2>{{ page.header.title }}</h2>
|
||||
<h2>{{ title }}</h2>
|
||||
{% if subtitle %}
|
||||
<p>{{ subtitle }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{% if page.header.primaryImage %}
|
||||
{{ page.media[page.header.primaryImage].cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
|
||||
{% else %}
|
||||
{{ page.media.images|first.cropZoom(1038,437).loading('lazy').html(page.title, page.title, 'image featured')|raw }}
|
||||
{% 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 %}
|
||||
|
|
Loading…
Add table
Reference in a new issue