Commit first draft of tile pattern - tile view mode for nodes
This commit is contained in:
parent
ce002857f7
commit
94f899bd23
1 changed files with 53 additions and 0 deletions
53
agaric/templates/patterns/tile/pattern-tile.html.twig
Normal file
53
agaric/templates/patterns/tile/pattern-tile.html.twig
Normal file
|
@ -0,0 +1,53 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display a one-column layout.
|
||||
*
|
||||
* Available variables:
|
||||
* - content: The content for this layout.
|
||||
* - attributes: HTML attributes for the layout <div>.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
|
||||
{% if content %}
|
||||
|
||||
<div class="column is-one-third">
|
||||
|
||||
|
||||
{% set bundle = content['#node'].bundle %}
|
||||
{% set classes = [ 'is-child', 'card', 'card-project', 'hero-' ~ bundle|replace({"_": "-"}) ] %}
|
||||
{# expected if statement would go here #}
|
||||
{% set classes = classes|merge([ 'is-berry' ]) %}
|
||||
|
||||
{% set title_paragraph_index = null %}
|
||||
{% set has_title_paragraph = false %}
|
||||
{% if content.field_body_paragraph %}
|
||||
{% for i, paragraph in content.field_body_paragraph if i|first != '#' %}
|
||||
{% if content.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{% set title_paragraph_index = i %}
|
||||
{{ paragraph }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if not has_title_paragraph %}
|
||||
<a{{ attributes.addClass(classes) }}>
|
||||
{# Header hero region #}
|
||||
<div class="card-content">
|
||||
<div class="title">
|
||||
{{ content.title }}
|
||||
buuuut you do have a title paragraph
|
||||
</div>
|
||||
<p class="subtitle">
|
||||
{{ subtitle }}
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
{% endif %}{# content #}
|
Loading…
Reference in a new issue