Skip to content

Commit

Permalink
D8CORE-7662: Created a single collayout to added the filtered paragra…
Browse files Browse the repository at this point in the history
…ph into
  • Loading branch information
jenbreese authored and pookmish committed Feb 28, 2025
1 parent e2cba34 commit 5994d30
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{#
/**
* @file
* Default theme implementation to display one column layout.
*
* Available variables:
* - content: The content for this layout.
* - attributes: HTML attributes for the layout wrapper.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'layout',
'layout--layout-paragraphs-one-column-filters',
]
%}

{% if content %}
<div{{ attributes.addClass(classes) }}>

{% if content.main %}
<div {{ region_attributes.main.addClass('layout__region', 'layout__region--main') }}>
{{ content.main }}
</div>
{% endif %}

</div>
{% endif %}

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.layout--layout-paragraphs-one-column-filters .layout__region {
display: flex;
flex-direction: column;
gap: 30px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace Drupal\stanford_layout_paragraphs\Layouts;

use Drupal\Core\Layout\LayoutDefault;

/**
* One column layout class.
*/
class OneColumnFilters extends LayoutDefault {

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ layout_paragraphs_1_column:
icon_map:
- [main]

layout_paragraphs_1_column_filters:
label: '1 Column with Filters'
category: 'Stanford Layout Paragraphs'
class: '\Drupal\stanford_layout_paragraphs\Layouts\OneColumnFilters'
path: layouts/one_column_filters
template: layout-paragraphs-one-column-filters
library: stanford_layout_paragraphs/one_column-filters
regions:
main:
label: Main content
default_region: main
icon_map:
- [main]

layout_paragraphs_2_column:
label: '2 Column'
category: 'Stanford Layout Paragraphs'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ one_column:
component:
layouts/one_column/one-column.css: {}

one_column_filters:
css:
component:
layouts/one_column_filters/one-column-filters.css: {}

two_column:
css:
component:
Expand Down

0 comments on commit 5994d30

Please sign in to comment.