Add space before/after settings
This commit is contained in:
@@ -35,6 +35,15 @@ class ContainerViewHelper extends AbstractViewHelper
|
||||
{
|
||||
use CompileWithRenderStatic;
|
||||
|
||||
/**
|
||||
* @var int[]
|
||||
*/
|
||||
protected static $scale = [
|
||||
'none' => 0,
|
||||
'default' => 8,
|
||||
'large' => 16,
|
||||
];
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
@@ -80,6 +89,17 @@ class ContainerViewHelper extends AbstractViewHelper
|
||||
if ($arguments['cssClasses'] !== null) {
|
||||
$classes[] = $arguments['cssClasses'];
|
||||
}
|
||||
|
||||
$scaleTop = empty($data['space_before_class']) ? static::$scale['default'] : static::$scale[$data['space_before_class']];
|
||||
$scaleBottom = empty($data['space_after_class']) ? static::$scale['default'] : static::$scale[$data['space_after_class']];
|
||||
|
||||
$classes[] = sprintf('pt-%d', $scaleTop);
|
||||
$classes[] = sprintf('pb-%d', $scaleBottom);
|
||||
|
||||
if ('default' !== $data['frame_class']) {
|
||||
$classes[] = $data['frame_class'];
|
||||
}
|
||||
|
||||
if (true === $arguments['rteContent'] || count($classes) > 0) {
|
||||
return sprintf('<div class="%s"%s>%s</div>', implode(' ', $classes), $arguments['rteContent'] ? ' data-rte-content' : '', $content);
|
||||
}
|
||||
|
||||
@@ -104,6 +104,28 @@ TCEFORM {
|
||||
altLabels.1848 = Blogeintrag
|
||||
}
|
||||
|
||||
space_before_class {
|
||||
removeItems := addToList(extra-small, small, medium, extra-large)
|
||||
altLabels.. = Standard
|
||||
addItems {
|
||||
none = ohne
|
||||
}
|
||||
}
|
||||
|
||||
space_after_class < .space_before_class
|
||||
|
||||
# frame_class {
|
||||
# label = Hintergrund
|
||||
# removeItems := addToList(ruler-before, ruler-after, indent, indent-left, indent-right, none)
|
||||
# altLabels {
|
||||
# default = ohne
|
||||
# }
|
||||
# addItems {
|
||||
# bg-ep-primary-10 = mit
|
||||
# }
|
||||
# }
|
||||
#
|
||||
frame_class.disabled = 1
|
||||
table_bgColor.disabled = 1
|
||||
table_border.disabled = 1
|
||||
table_cellspacing.disabled = 1
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
|
||||
<f:section name="Main">
|
||||
<div class="py-8 bg-ep-primary-10">
|
||||
<f:render partial="Header/Standalone" arguments="{_all}"/>
|
||||
<f:if condition="{data.header}">
|
||||
<div class="container mb-8">
|
||||
<f:render partial="Header/Header" arguments="{header: data.header, subheader: data.subheader, layout: data.header_layout, link: data.header_link, default: settings.defaultHeaderType}" />
|
||||
</div>
|
||||
</f:if>
|
||||
<div class="container">
|
||||
<f:render section="Teasers" arguments="{_all}"/>
|
||||
<f:if condition="{settings.showMoreLink}">
|
||||
|
||||
Reference in New Issue
Block a user