Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 22 additions & 26 deletions templates/includes/_block--with-button.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,11 @@
/**
* @file
* Theme override to display a block.
* ~ Render a block with a more button in the "header-with-button" pattern
* ~ Render a block with a more button in the "header-with-button" pattern.
* ~ Allow additional classes from including template.
* ~ Use "include ... with" in your block template to call this template and
* ~ specify the URL for the more link.
*
* Available variables:
* - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values.
* - label: The configured label for the block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here.
* - content: The content of this block.
* - attributes: array of HTML attributes populated by modules, intended to
* be added to the main container tag of this template.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
* See cwd_base/block.html.twig for available variables and other info.
*
* @see template_preprocess_block()
*/
Expand All @@ -36,19 +19,32 @@
]
%}

{% set classes = classes|merge(block_add_classes|default([])) %}
{% set more_link = set_more_link|default('#') %}
{% set more_label = set_more_label|default('More') %}
{% set more_placement = set_more_placement|default('top') %}

{% block block_class_override %}
<div{{ attributes.addClass(classes) }}>
{% endblock %}
{% if label %}
<div class="constrain-480">
<div class="header-with-button">
<h2{{ title_attributes }}>{{ label }}</h2>
<div class="buttons"><a href="{{ more_link }}" class="link-button"><span>{{ more_label }}</span><span class="zmdi zmdi-arrow-right"></span></a></div>
</div>
</div>
{% if more_placement == 'top' %}
<div class="constrain-480">
<div class="header-with-button">
<h2{{ title_attributes }}>{{ label }}</h2>
<div class="buttons"><a href="{{ more_link }}" class="link-button"><span>{{ more_label }}</span><span class="zmdi zmdi-arrow-right"></span></a></div>
</div>
</div>
{% else %}
<div class="constrain-480">
<h2{{ title_attributes }}>{{ label }}</h2>
</div>
{% endif %}
{% endif %}
{% block content %}
{{ content }}
{% endblock %}
{% if more_placement == 'bottom' %}
<div class="buttons"><a href="{{ more_link }}" class="link-button"><span>{{ more_label }}</span><span class="zmdi zmdi-arrow-right"></span></a></div>
{% endif %}
</div>