View All Components

Component: Alert

Features

  1. Change theme
  2. Drag and drop

Notes

  1. Minimal field.html.twig used to loop paragraph content

Watch Short Video

paragraph--alert.html.twig

 

{% set col = paragraph.field_alert_text_color.value %}
{% set theme = paragraph.field_theme_color.value %}
{% set text = content.field_alert_text %}

{% block paragraph %}
<div class="row">
{% block content %}
<div class="alert custom-alert {{ col }} bg-{{ theme }}">
{{ text }}
</div>
{% endblock %}
</div>
{% endblock paragraph %}

field.html.twig

 

{% for item in items %}
{{ item.content }}
{% endfor %}