Skip to content
Snippets Groups Projects
Commit 21710ee3 authored by Thomas Frobieter's avatar Thomas Frobieter
Browse files

Moved fancy background image markup + variables to an include file (DRY) =>...

Moved fancy background image markup + variables to an include file (DRY) => Added missing variable for the closing markup block (Scope issue)
parent 4f599a37
No related branches found
Tags 4.1.18
No related merge requests found
{#
!! This file is intendet to be used only with twigs https://twig.symfony.com/doc/2.x/tags/use.html
!! This file is intendet to be used only with twigs "use" https://twig.symfony.com/doc/2.x/tags/use.html
Check out paragraph--drowl-paragraphs-types--layout.html.twig for an example.
#}
{% block background_image_opening_wrapper %}
{# Prepare background image things #}
{% set background_image_attributes = create_attribute() %}
{# Prepare background image things #}
{% set has_background_image = content.field_paragraphs_background_img.0 ? true : false %}
{% set background_image_attributes = create_attribute() %}
{% set background_image_fixed = false %}
{% set background_image_parallax = false %}
{% set background_image_blurred = false %}
......@@ -54,9 +54,6 @@
{{ attach_library('drowl_paragraphs/parallax') }}
{% endif %}
{% if add_layout_container %}
<div class="grid-container">
{% endif %}
{# "Background" image #}
{% if has_background_image %}
{# Move all margin classes to the background wrapper #}
......@@ -104,6 +101,11 @@
{% block background_image_closing_wrapper %}
{# "Background" image #}
{#
TODO: We cant set the variables outside the blocks here, so because of the block scope we have to redeclare it here again.
Any better approaches to solve this?
#}
{% set has_background_image = content.field_paragraphs_background_img.0 ? true : false %}
{% if has_background_image %}
</div>
{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment