.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'layout',
'layout--twocol-33-66',
]
%}
{% if content %}
{% if content.top %}
{{ content.top }}
{% endif %}
{% if content.first %}
{{ content.first }}
{% endif %}
{% if content.second %}
{{ content.second }}
{% endif %}
{% if content.bottom %}
{{ content.bottom }}
{% endif %}
{% endif %}
layouts/twocol_33_66/twocol_33_66.css 0000644 00000000717 15053776574 0013264 0 ustar 00 /*
* @file
* Provides the layout styles for layout_threecol_25_50_25.
*/
.layout--twocol-33-66 {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr));
gap: 20px;
}
@media screen and (min-width: 40em) {
.layout--twocol-33-66 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.layout--twocol-33-66 > .layout__region--second {
grid-column-end: span 2;
}
.layout--twocol-33-66 .full-row {
grid-column-end: span 3;
}
}
layouts/twocol_66_33/layout--twocol-66-33.html.twig 0000644 00000002146 15053776574 0015633 0 ustar 00 {#
/**
* @file
* Default theme implementation to display a two-column layout.
*
* Available variables:
* - content: The content for this layout.
* - attributes: HTML attributes for the layout
.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'layout',
'layout--twocol-66-33',
]
%}
{% if content %}
{% if content.top %}
{{ content.top }}
{% endif %}
{% if content.first %}
{{ content.first }}
{% endif %}
{% if content.second %}
{{ content.second }}
{% endif %}
{% if content.bottom %}
{{ content.bottom }}
{% endif %}
{% endif %}
layouts/twocol_66_33/twocol_66_33.css 0000644 00000000716 15053776574 0013263 0 ustar 00 /*
* @file
* Provides the layout styles for layout_threecol_25_50_25.
*/
.layout--twocol-66-33 {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr));
gap: 20px;
}
@media screen and (min-width: 40em) {
.layout--twocol-66-33 {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
.layout--twocol-66-33 > .layout__region--first {
grid-column-end: span 2;
}
.layout--twocol-66-33 .full-row {
grid-column-end: span 3;
}
}
nxd_layouts.info.yml 0000644 00000000164 15053776574 0010616 0 ustar 00 name: "NXD: Layouts"
type: module
description: A custom layouts.
package: 4i4
core_version_requirement: '^10 | ^11'
nxd_layouts.libraries.yml 0000644 00000001604 15053776574 0011637 0 ustar 00 onecol:
version: VERSION
css:
theme:
layouts/onecol/onecol.css: {}
twocol:
version: VERSION
css:
theme:
layouts/twocol/twocol.css: {}
twocol_66_33:
version: VERSION
css:
theme:
layouts/twocol_66_33/twocol_66_33.css: {}
twocol_33_66:
version: VERSION
css:
theme:
layouts/twocol_33_66/twocol_33_66.css: {}
threecol_25_50_25:
version: VERSION
css:
theme:
layouts/threecol_25_50_25/threecol_25_50_25.css: {}
threecol_50_25_25:
version: VERSION
css:
theme:
layouts/threecol_50_25_25/threecol_50_25_25.css: {}
threecol_25_25_50:
version: VERSION
css:
theme:
layouts/threecol_25_25_50/threecol_25_25_50.css: {}
threecol_33_34_33:
version: VERSION
css:
theme:
layouts/threecol_33_34_33/threecol_33_34_33.css: {}
fourcol:
version: VERSION
css:
theme:
layouts/fourcol/fourcol.css: {}
src/Layout.php 0000644 00000004672 15053776574 0007355 0 ustar 00 getPluginDefinition()->get("regions") as $key => $region) {
$regions[$key] = $region['label'];
}
return $regions;
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
$regions = [];
foreach ($this->getRegions() as $region => $label) {
$regions[$region]['fit'] = FALSE;
$regions[$region]['className'] = "";
}
return parent::defaultConfiguration() + [
'size' => '',
'regions' => $regions,
];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$configuration = $this->getConfiguration();
$regions = $this->getRegions();
$form["size"] = [
'#type' => 'select',
'#title' => $this->t("Container size"),
'#options' => [
'' => $this->t("normal"),
'wide' => $this->t("wide"),
'narrow' => $this->t("narrow"),
],
'#default_value' => $configuration['size'],
];
if (count($regions) > 1) {
$form["condensed"] = [
'#type' => 'checkbox',
'#title' => $this->t("Condensed"),
'#default_value' => $configuration['condensed'],
];
}
$form['regions'] = [
'#tree' => TRUE,
];
foreach ($regions as $region => $label) {
$form['regions'][$region] = [
'#type' => 'details',
'#title' => $label,
];
$form['regions'][$region]["fit"] = [
'#type' => 'checkbox',
'#title' => $this->t("No margins"),
'#default_value' => $configuration['regions'][$region]['fit'] ?? null,
];
$form['regions'][$region]['className'] = [
'#type' => 'textfield',
'#title' => $this->t('Class attribute'),
'#default_value' => $configuration['regions'][$region]['className'] ?? null,
];
}
return $form;
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
$this->configuration['size'] = $form_state->getValue('size');
$this->configuration['condensed'] = $form_state->getValue('condensed');
$this->configuration['regions'] = $form_state->getValue('regions');
}
}
src/Plugin/Layout/FourCol.php 0000644 00000001755 15053776574 0012163 0 ustar 00