Portfolio - Components
View All Components
Component: Advanced Heading
Features
- choice of h1-h6
- choose position
- choose theme
- transform heading e.g. uppercase
- flexible with drag and drop
Notes
- allows flexibility
- loop content with
field.html.twig
Watch Short Video
My Regular Heading
Transformed Heading
paragraph--advanced-heading.html.twig
{% set heading = paragraph.field_heading_type.value %}
{% set col = paragraph.field_text_color.value %}
{% set align = paragraph.field_text_alignment.value %}
{% set transform = paragraph.field_text_transform.value %}
{% set title = paragraph.field_heading_title.value %}
{% block paragraph %}
{% block content %}
<div class="row">
{% for i in 1..6 %}
{% if heading == "heading_" ~ i %}
<h{{ i }} class="{{ col }} {{ align }} {{ transform }}">{{ title }}</h{{ i }}>
{% endif %}
{% endfor %}
</div>
{% endblock %}
{% endblock paragraph %}
field.html.twig
{% for item in items %}
{{ item.content }}
{% endfor %}