Improved the declaration of show_breadcrumbs and show_pagination variables.

This commit is contained in:
pmoreno.rodriguez 2023-02-06 17:23:21 +01:00
parent e010a528a3
commit 905acfe751
2 changed files with 10 additions and 17 deletions

View file

@ -3,16 +3,8 @@
{% set collection = page.collection() %}
{% set base_url = page.url %}
{% set feed_url = base_url %}
{% if page.header.show_breadcrumbs is defined %}
{% set show_breadcrumbs = page.header.show_breadcrumbs %}
{% else %}
{% set show_breadcrumbs = true %}
{% endif %}
{% if page.header.show_pagination is defined %}
{% set show_pagination = page.header.show_pagination %}
{% else %}
{% set show_pagination = true %}
{% endif %}
{% set show_breadcrumbs = header_var('show_breadcrumbs')|defined(true) %}
{% set show_pagination = header_var('show_pagination')|defined(true) %}
{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %}
{% set title = page.title|raw %}
@ -40,7 +32,7 @@
{% endblock %}
{% block content %}
<div class="heading">
<header>
<div class="title">
<h2>{{ title }}</h2>
@ -49,16 +41,15 @@
{% endif %}
</div>
</header>
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
{% include 'partials/breadcrumbs.html.twig' %}
{% endif %}
{% if image %}
{{ image.cropZoom(1038,437).loading('lazy').html(title, title, 'image featured')|raw }}
{% endif %}
{{ page.content|raw }}
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
{% include 'partials/breadcrumbs.html.twig' %}
{% endif %}
</div>
{% for child in collection %}
{% include 'partials/blog_item.html.twig' with {'page':child, 'truncate':true} %}

View file

@ -2,7 +2,7 @@
{% set base_url = page.parent.url %}
{% set feed_url = base_url %}
{% set show_breadcrumbs = header_var('show_breadcrumbs', [page, blog]) %}
{% set show_breadcrumbs = header_var('show_breadcrumbs')|defined(true) %}
{% if base_url == '/' %}
{% set base_url = '' %}
@ -18,7 +18,9 @@
{% block content %}
{% if show_breadcrumbs and config.plugins.breadcrumbs.enabled %}
<div class="heading">
{% include 'partials/breadcrumbs.html.twig' %}
</div>
{% endif %}
{% include 'partials/blog_item.html.twig' with {'truncate':false} %}