Commit fad6f916 authored by Abdullah Yassin's avatar Abdullah Yassin
Browse files

Issue #3305766: Change twig structure based on new row and container components changes

parent 3925d7a8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -99,10 +99,11 @@ export const _3ColumnsLayout = (args) => {

  return threeColumnsLayout({
    attributes: new DrupalAttribute(),
    container_attributes: new DrupalAttribute(),
    row_attributes: new DrupalAttribute(),
    col_attributes: new DrupalAttribute(),
    row: args.row && "row",
    container: args.container && "container",
    content: args.content,
    container_classes: [],
    row_classes: [],
    columns: columnsData
+21 −5
Original line number Diff line number Diff line
{% set container_classes = container ? container_classes|merge([container]) : [''] %}
{% set row_classes = row ? row_classes|merge([row]) : [''] %}

{#
  * One column layout component.
  * Available config:
  * - attributes: Drupal attributes for One column layout component.
  * - container_attributes: Drupal attributes for row component.
  * - row_attributes: Drupal attributes for row component.
  * - col_attributes: Drupal attributes for column component.
  * - row: Boolean variable passed to row component to add row class or not.
  * - container: Boolean variable passed to container component to add container class or not.
  * - container_classes: An array of additional classes passed to container component.
  * - row_classes: An array of additional classes passed to row component.
  * - columns: An array of columns objects, contains:
  *    - attributes: Drupal attributes.
  *    - size: Bootstrab grid classes for columns, like: col-md-12, col-sm-6, etc... .
  *    - content: Column content.
#}

{# Embed container component #}
{% embed "@atoms/container/container.twig" with {
  container: true,
  attributes: container_attributes,
  withContainer: container,
  utility_classes: container_classes
} %}
  {% block children %}

    {# Embed row component #}
    {% embed "@atoms/row/row.twig" with {
      attributes: row_attributes,
      withRow: row,
      utility_classes: row_classes
    } %}
      {% block children %}
      {% block content %}

        {% for col in columns %}
          {# Embed column component #}