You are here

views-bootstrap-media-object.html.twig in Views Bootstrap 8.3

Same filename and directory in other branches
  1. 8.4 templates/views-bootstrap-media-object.html.twig
{# @TODO: How to remove bootstrap theme's default .img-responsive class on image fields, which doesn't work with .media-left, etc. For now, I'm using .pull-left as a fix. #}
<div id="{{ id }}" {{ attributes.addClass(classes) }}>
    {% for row in rows -%}
          <div class="media">

              {% if image_class == "media-left" %}
                  <div class="pull-left">
                      {{ row.image }}
                  </div>
              {% endif %}

              {% if image_class == "media-middle" %}
                  <div class="media-middle">
                      {{ row.image }}
                  </div>
              {% endif %}

              <div class="media-body">
                    {% if row.heading %}
                          <h3 class="media-heading">
                              {{ row.heading }}
                          </h3>
                    {% endif %}
                    {% if row.body %}
                        {{ row.body }}
                    {% endif %}

                  {% if image_class == "media-right" %}
                      <div class="pull-right">
                          {{ row.image }}
                      </div>
                  {% endif %}

              </div>
          </div>
    {%- endfor %}
</div>

File

templates/views-bootstrap-media-object.html.twig
View source
  1. {# @TODO: How to remove bootstrap theme's default .img-responsive class on image fields, which doesn't work with .media-left, etc. For now, I'm using .pull-left as a fix. #}
  2. <div id="{{ id }}" {{ attributes.addClass(classes) }}>
  3. {% for row in rows -%}
  4. <div class="media">
  5. {% if image_class == "media-left" %}
  6. <div class="pull-left">
  7. {{ row.image }}
  8. </div>
  9. {% endif %}
  10. {% if image_class == "media-middle" %}
  11. <div class="media-middle">
  12. {{ row.image }}
  13. </div>
  14. {% endif %}
  15. <div class="media-body">
  16. {% if row.heading %}
  17. <h3 class="media-heading">
  18. {{ row.heading }}
  19. </h3>
  20. {% endif %}
  21. {% if row.body %}
  22. {{ row.body }}
  23. {% endif %}
  24. {% if image_class == "media-right" %}
  25. <div class="pull-right">
  26. {{ row.image }}
  27. </div>
  28. {% endif %}
  29. </div>
  30. </div>
  31. {%- endfor %}
  32. </div>