Skip to content

Instantly share code, notes, and snippets.

@claudiainbytes
Last active December 6, 2018 22:54
Show Gist options
  • Save claudiainbytes/d9c9d84fa16d4afcf488086711082e98 to your computer and use it in GitHub Desktop.
Save claudiainbytes/d9c9d84fa16d4afcf488086711082e98 to your computer and use it in GitHub Desktop.

Revisions

  1. claudiainbytes revised this gist Dec 6, 2018. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -16,3 +16,8 @@
    #And this module Twig Field https://www.drupal.org/project/twig_field_value

    <img src="{{ node.field_image.entity.uri.value | image_style('despliegue_1366x768_px') }}" alt="{{ node.field_image.alt }}"/>

    # Example 3

    <img class="img-responsive" src="{{ content.field_imagen.0['#item'].entity.uri.value | image_style('minuto_a_minuto_560x315_px') }}" alt="{{ content.field_imagen['#items'].alt }}"/>

  2. claudiainbytes created this gist Dec 6, 2018.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    # Example 1.

    <div class="col-md-8 blog--caja-right">
    {% set imageblog = {
    '#theme': 'image_style',
    '#style_name': 'despliegue_blog',
    '#uri': node.field_image.entity.uri.value,
    '#attributes': { class: 'img-responsive' },
    } %}
    {{ imageblog }}
    </div>

    # Example 2.

    #Install the Twig Tweak Module https://www.drupal.org/project/twig_tweak
    #And this module Twig Field https://www.drupal.org/project/twig_field_value

    <img src="{{ node.field_image.entity.uri.value | image_style('despliegue_1366x768_px') }}" alt="{{ node.field_image.alt }}"/>