Print only the title paragraph
This commit is contained in:
parent
d555ba5b57
commit
b8aea06ffd
1 changed files with 9 additions and 30 deletions
|
@ -1,51 +1,30 @@
|
|||
{#
|
||||
/**
|
||||
* @file
|
||||
* Default theme implementation to display a one-column layout.
|
||||
* Default theme implementation to display a pargraph section.
|
||||
*
|
||||
* Available variables:
|
||||
* - content: The content for this layout.
|
||||
* - attributes: HTML attributes for the layout <div>.
|
||||
* It extracts the title paragraph, if any, from a body paragraphs listing.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*/
|
||||
#}
|
||||
{{ dump(_context|keys) }}
|
||||
|
||||
<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 title.field_body_paragraph %}
|
||||
Finally
|
||||
{% for i, paragraph in title.field_body_paragraph if i|first != '#' %}
|
||||
{% if title.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% if paragraphs.field_body_paragraph %}
|
||||
{% for i, paragraph in paragraphs.field_body_paragraph if i|first != '#' %}
|
||||
{% if paragraphs.field_body_paragraph['#items'][i].entity.type.0.entity.id == 'title' %}
|
||||
{% set has_title_paragraph = true %}
|
||||
{% set title_paragraph_index = i %}
|
||||
Wow
|
||||
{{ paragraph }}
|
||||
<div class="column is-one-third">
|
||||
{{ paragraph }}
|
||||
</div>
|
||||
{% 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>
|
||||
<!-- This content not shown because it does not have a title paragraph. -->
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue