54 lines
1.5 KiB
Twig
Executable File
54 lines
1.5 KiB
Twig
Executable File
{# Create classes array. The 'node' class is required for contextual edit links. #}
|
|
{% set classes = [
|
|
'node'
|
|
] %}
|
|
|
|
{# BEM inspired class syntax: https://en.bem.info/
|
|
Enable this code if you would like node classes like "article article--layout-teaser", where article is the content type and teaser is the view mode.
|
|
{% set classes = classes|merge([
|
|
node.bundle|clean_class,
|
|
view_mode ? node.bundle|clean_class ~ '--layout-' ~ view_mode|clean_class
|
|
]) %}
|
|
{% set title_classes = [
|
|
node.bundle|clean_class ~ '__title'
|
|
] %}
|
|
#}
|
|
|
|
<article{{ attributes.addClass(classes) }}>
|
|
|
|
{% if title_prefix or title_suffix or display_submitted or unpublished or page is empty and label %}
|
|
<header>
|
|
{{ title_prefix }}
|
|
{% if not page and label %}
|
|
<h2{{ title_attributes.addClass(title_classes) }}>
|
|
<a href="{{ url }}" rel="bookmark">{{ label }}</a>
|
|
</h2>
|
|
{% endif %}
|
|
{{ title_suffix }}
|
|
|
|
{% if display_submitted %}
|
|
<div class="submitted">
|
|
{{ author_picture }}
|
|
{% trans %}Submitted by {{ author_name }} on {{ date }}{% endtrans %}
|
|
{{ metadata }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if not node.published %}
|
|
<p class="node--unpublished">{{ 'Unpublished'|t }}</p>
|
|
{% endif %}
|
|
</header>
|
|
{% endif %}
|
|
|
|
<div{{ content_attributes.addClass('content') }}>
|
|
{{ content|without('links') }}
|
|
</div><!-- /.content -->
|
|
|
|
{% if content.links %}
|
|
<div class="links">
|
|
{{ content.links }}
|
|
</div><!-- /.links -->
|
|
{% endif %}
|
|
|
|
</article><!-- /.node -->
|