Skip to content

Commit

Permalink
Move viewTypeName property inside the conditional in block.html.twig,…
Browse files Browse the repository at this point in the history
… add blockLocale property
  • Loading branch information
emodric committed Nov 9, 2022
1 parent bc57072 commit 316aee5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions templates/nglayouts/themes/app/block/block.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@

{% set block_content = (block('content') is defined ? block('content') : '')|trim %}

{% set view_type_name = block.viewType %}
{% if block_content is not empty or show_empty_wrapper %}
{% set view_type_name = block.viewType %}

{% if block.definition.hasViewType(view_type_name, block) %}
{% set view_type_name = block.definition.viewType(view_type_name, block).name %}
{% endif %}
{% if block.definition.hasViewType(view_type_name, block) %}
{% set view_type_name = block.definition.viewType(view_type_name, block).name %}
{% endif %}

{% if block_content is not empty or show_empty_wrapper %}
<ngl-block blockId="{{ block.id }}" viewTypeName="{{ view_type_name }}">
<ngl-block blockId="{{ block.id }}" blockLocale="{{ block.locale }}" viewTypeName="{{ view_type_name }}">
<div
class="{{ css_classes|join(' ') }}"
{% if css_id is not empty %}id="{{ css_id }}"{% endif %}
Expand Down

0 comments on commit 316aee5

Please sign in to comment.