Skip to content

Instantly share code, notes, and snippets.

View thamas's full-sized avatar

Tamás Hajas thamas

View GitHub Profile
@ModulesUnraveled
ModulesUnraveled / 1. flexible-grid.twig
Last active November 13, 2020 02:29
Nested Paragraphs + PL
{#
# This is the PL template for the "parent" pattern
#}
{% set flexible_grid_base_class = flexible_grid_base_class|default('flexible-grid') %}
{% set item_count = flexible_grid_item_count|default(rows|length) %}
{# Dynamically define grid columns #}
{% if item_count is divisible by(3) %}
{% set flexible_grid_modifiers = ["columns-3"] %}

trzalica [Oct 5th at 12:37 AM] Hi all! I wrote an article about how I use Responsive images in PL/Drupal... Maybe it will be helpful to some of you who are using/planing to use Pattern Lab in your projects. mosaicwebsites.com/blog/responsive-images-emulsify-pl-theme-easy-way

64 replies danny_englander [6 days ago] @trzalica Excellent. So if I understand this correctly, your first block of code (which has things like "responsive_image_base_class": your_component_variable_name_image_base_class,) that defines everything would appear in a Pattern Lab Twig file, say card.twig for example. Then your second block of code i.e. {{ content.field_machine_name_of_responsive_image_field[0] }} would be part of an embed on the Drupal side in a drupal twig template?