... | ... |
@@ -27,6 +27,15 @@ $GLOBALS['TL_DCA']['tl_content']['palettes']['grid_placement_wrapper'] = ' |
27 | 27 |
{invisible_legend:hide},invisible,start,stop |
28 | 28 |
'; |
29 | 29 |
|
30 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['display_text'] = ' |
|
31 |
+ {type_legend},type; |
|
32 |
+ {display_text_legend},vr_dt_plainText,vr_dt_size; |
|
33 |
+ {template_legend:hide},customTpl; |
|
34 |
+ {protected_legend:hide},protected; |
|
35 |
+ {expert_legend:hide},cssID; |
|
36 |
+ {invisible_legend:hide},invisible,start,stop |
|
37 |
+'; |
|
38 |
+ |
|
30 | 39 |
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['vr_bw_addImage'] = 'vr_bw_bgSRC,size,vr_bw_bgSize,vr_bw_bgPos,vr_bw_bgOpacity,vr_bw_bgBesideContent'; |
31 | 40 |
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['vr_bw_bgBesideContent'] = 'vr_bw_bgHorizontalPosition,vr_bw_bgAsideContentResponsive'; |
32 | 41 |
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['vr_bw_minHeight_-mh-ratio'] = 'vr_bw_mh_ratio'; |
... | ... |
@@ -352,3 +361,23 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['vr_subline'] = [ |
352 | 361 |
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'), |
353 | 362 |
'sql' => "varchar(255) NOT NULL default ''" |
354 | 363 |
]; |
364 |
+ |
|
365 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['vr_dt_size'] = [ |
|
366 |
+ 'inputType' => 'select', |
|
367 |
+ 'options' => ['small', 'medium', 'large', 'h1', 'h2', 'h3'], |
|
368 |
+ 'reference' => &$GLOBALS['TL_LANG']['tl_content']['vr_dt_size_options'], |
|
369 |
+ 'eval' => [ |
|
370 |
+ 'includeBlankOption' => true, |
|
371 |
+ 'tl_class' => 'w50' |
|
372 |
+ ], |
|
373 |
+ 'sql' => "varchar(32) NOT NULL default ''" |
|
374 |
+]; |
|
375 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['vr_dt_plainText'] = [ |
|
376 |
+ 'inputType' => 'textarea', |
|
377 |
+ 'eval' => [ |
|
378 |
+ 'mandatory'=>true, |
|
379 |
+ 'helpwizard'=>true |
|
380 |
+ ], |
|
381 |
+ 'explanation' => 'insertTags', |
|
382 |
+ 'sql' => "mediumtext NULL" |
|
383 |
+]; |
... | ... |
@@ -18,6 +18,14 @@ |
18 | 18 |
<source>Provides a grid wrapper where you can define the position of the nested fragments.</source> |
19 | 19 |
<target>Bietet einen Grid-Wrapper, in dem Sie die Position der verschachtelten Fragmente festlegen können.</target> |
20 | 20 |
</trans-unit> |
21 |
+ <trans-unit id="CTE.display_text.0"> |
|
22 |
+ <source>Display text</source> |
|
23 |
+ <target>Display-Text</target> |
|
24 |
+ </trans-unit> |
|
25 |
+ <trans-unit id="CTE.display_text.1"> |
|
26 |
+ <source>A highlighted text block that can be prominently placed within a background wrapper.</source> |
|
27 |
+ <target>Ein hervorgehobener Textblock, der innerhalb eines Hintergrundumschlags prominent platziert werden kann.</target> |
|
28 |
+ </trans-unit> |
|
21 | 29 |
</body> |
22 | 30 |
</file> |
23 | 31 |
</xliff> |
... | ... |
@@ -236,6 +236,27 @@ |
236 | 236 |
<source>Grid placement</source> |
237 | 237 |
<target>Raster-Platzierung</target> |
238 | 238 |
</trans-unit> |
239 |
+ |
|
240 |
+ <trans-unit id="tl_content.vr_dt_plainText.0"> |
|
241 |
+ <source>Display text</source> |
|
242 |
+ <target>Display-Text</target> |
|
243 |
+ </trans-unit> |
|
244 |
+ <trans-unit id="tl_content.vr_dt_plainText.1"> |
|
245 |
+ <source>The display text as a plain text.</source> |
|
246 |
+ <target>Der Display-Text als simpler Text.</target> |
|
247 |
+ </trans-unit> |
|
248 |
+ <trans-unit id="tl_content.vr_dt_size.0"> |
|
249 |
+ <source>Text size</source> |
|
250 |
+ <target>Text-Größe</target> |
|
251 |
+ </trans-unit> |
|
252 |
+ <trans-unit id="tl_content.vr_dt_size.1"> |
|
253 |
+ <source>The desired size of the display text.</source> |
|
254 |
+ <target>Die gewünschte Text-Größe des Display-Texts.</target> |
|
255 |
+ </trans-unit> |
|
256 |
+ <trans-unit id="tl_content.display_text_legend"> |
|
257 |
+ <source>Display text</source> |
|
258 |
+ <target>Display-Text</target> |
|
259 |
+ </trans-unit> |
|
239 | 260 |
</body> |
240 | 261 |
</file> |
241 | 262 |
</xliff> |
... | ... |
@@ -14,6 +14,12 @@ |
14 | 14 |
<trans-unit id="CTE.grid_placement_wrapper.1"> |
15 | 15 |
<source>Provides a grid wrapper where you can define the position of the nested fragments.</source> |
16 | 16 |
</trans-unit> |
17 |
+ <trans-unit id="CTE.display_text.0"> |
|
18 |
+ <source>Display text</source> |
|
19 |
+ </trans-unit> |
|
20 |
+ <trans-unit id="CTE.display_text.1"> |
|
21 |
+ <source>A highlighted text block that can be prominently placed within a background wrapper.</source> |
|
22 |
+ </trans-unit> |
|
17 | 23 |
</body> |
18 | 24 |
</file> |
19 | 25 |
</xliff> |
... | ... |
@@ -126,6 +126,16 @@ |
126 | 126 |
<trans-unit id="tl_content.grid_placement_legend"> |
127 | 127 |
<source>Grid placement</source> |
128 | 128 |
</trans-unit> |
129 |
+ |
|
130 |
+ <trans-unit id="tl_content.vr_dt_plainText.0"> |
|
131 |
+ <source>Display text</source> |
|
132 |
+ </trans-unit> |
|
133 |
+ <trans-unit id="tl_content.vr_dt_plainText.1"> |
|
134 |
+ <source>The display text as a plain text.</source> |
|
135 |
+ </trans-unit> |
|
136 |
+ <trans-unit id="tl_content.display_text_legend"> |
|
137 |
+ <source>Display text</source> |
|
138 |
+ </trans-unit> |
|
129 | 139 |
</body> |
130 | 140 |
</file> |
131 | 141 |
</xliff> |
132 | 142 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,14 @@ |
1 |
+{% extends "@Contao/content_element/_base.html.twig" %} |
|
2 |
+{% use "@Contao/component/_rich_text.html.twig" %} |
|
3 |
+ |
|
4 |
+{% set attributes = attrs() |
|
5 |
+ .addClass('reveal') |
|
6 |
+ .mergeWith(attributes|default) |
|
7 |
+%} |
|
8 |
+ |
|
9 |
+{% block content %} |
|
10 |
+ {# Richtext #} |
|
11 |
+ {% block text %} |
|
12 |
+ {% with {text, attributes: text_attributes|default} %}{{ block('rich_text_component') }}{% endwith %} |
|
13 |
+ {% endblock %} |
|
14 |
+{% endblock %} |
0 | 15 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,24 @@ |
1 |
+.content-display-text { |
|
2 |
+ --inner-padding: 0; |
|
3 |
+ display: flex; |
|
4 |
+ align-items: center; |
|
5 |
+ justify-content: center; |
|
6 |
+ padding: var(--inner-padding); |
|
7 |
+ position: relative; |
|
8 |
+ font-size: clamp(1.25rem, 7vw, 2.5rem); |
|
9 |
+ font-weight: 800; |
|
10 |
+ text-transform: uppercase; |
|
11 |
+ box-sizing: border-box; |
|
12 |
+} |
|
13 |
+.content-display-text > .rte { |
|
14 |
+ position: relative; |
|
15 |
+} |
|
16 |
+.content-display-text .text-small { |
|
17 |
+ font-size: clamp(1.25rem, 7vw, 2.5rem); |
|
18 |
+} |
|
19 |
+.content-display-text .text-medium { |
|
20 |
+ font-size: clamp(1.333rem, 7vw, 2.75rem); |
|
21 |
+} |
|
22 |
+.content-display-text .text-large { |
|
23 |
+ font-size: clamp(1.5rem, 7vw, 3rem); |
|
24 |
+} |
0 | 25 |
new file mode 100644 |
... | ... |
@@ -0,0 +1 @@ |
1 |
+.content-display-text{--inner-padding:0;display:flex;align-items:center;justify-content:center;padding:var(--inner-padding);position:relative;font-weight:800;text-transform:uppercase;box-sizing:border-box}.content-display-text>.rte{position:relative}.content-display-text,.content-display-text .text-small{font-size:clamp(1.25rem,7vw,2.5rem)}.content-display-text .text-medium{font-size:clamp(1.333rem,7vw,2.75rem)}.content-display-text .text-large{font-size:clamp(1.5rem,7vw,3rem)} |
|
0 | 2 |
\ No newline at end of file |
1 | 3 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,29 @@ |
1 |
+.content-display-text { |
|
2 |
+ --inner-padding: 0; |
|
3 |
+ |
|
4 |
+ display: flex; |
|
5 |
+ align-items: center; |
|
6 |
+ justify-content: center; |
|
7 |
+ padding: var(--inner-padding); |
|
8 |
+ position: relative; |
|
9 |
+ font-size: clamp(1.25rem, 7vw, 2.5rem); |
|
10 |
+ font-weight: 800; |
|
11 |
+ text-transform: uppercase; |
|
12 |
+ box-sizing: border-box; |
|
13 |
+ |
|
14 |
+ > .rte { |
|
15 |
+ position: relative; |
|
16 |
+ } |
|
17 |
+ |
|
18 |
+ .text-small { |
|
19 |
+ font-size: clamp(1.25rem, 7vw, 2.5rem); |
|
20 |
+ } |
|
21 |
+ |
|
22 |
+ .text-medium { |
|
23 |
+ font-size: clamp(1.333rem, 7vw, 2.75rem); |
|
24 |
+ } |
|
25 |
+ |
|
26 |
+ .text-large { |
|
27 |
+ font-size: clamp(1.5rem, 7vw, 3rem); |
|
28 |
+ } |
|
29 |
+} |
0 | 30 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,38 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+declare(strict_types=1); |
|
4 |
+ |
|
5 |
+namespace vonRotenberg\CoretoolsBundle\Controller\ContentElement; |
|
6 |
+ |
|
7 |
+use Contao\ContentModel; |
|
8 |
+use Contao\CoreBundle\Controller\ContentElement\AbstractContentElementController; |
|
9 |
+use Contao\CoreBundle\DependencyInjection\Attribute\AsContentElement; |
|
10 |
+use Contao\CoreBundle\Twig\FragmentTemplate; |
|
11 |
+use Contao\StringUtil; |
|
12 |
+use Contao\System; |
|
13 |
+use Symfony\Component\HttpFoundation\Request; |
|
14 |
+use Symfony\Component\HttpFoundation\Response; |
|
15 |
+ |
|
16 |
+#[AsContentElement(category: 'texts')] |
|
17 |
+class DisplayTextController extends AbstractContentElementController |
|
18 |
+{ |
|
19 |
+ protected function getResponse(FragmentTemplate $template, ContentModel $model, Request $request): Response |
|
20 |
+ { |
|
21 |
+ if (System::getContainer()->get('contao.routing.scope_matcher')->isFrontendRequest($request)) |
|
22 |
+ { |
|
23 |
+ $GLOBALS['TL_CSS'][] = 'bundles/vonrotenbergcoretools/css/display-text.min.css|static'; |
|
24 |
+ } |
|
25 |
+ |
|
26 |
+ $strText = $model->vr_dt_plainText ?: ''; |
|
27 |
+ |
|
28 |
+ if (!empty($strText) && !preg_match("/^h[1-3]$/",$model->vr_dt_size)) |
|
29 |
+ { |
|
30 |
+ $strText = '<div' . (!empty($model->vr_dt_size) ? ' class="text-' . strtolower(StringUtil::prepareSlug($model->vr_dt_size)) . '"' : '') . '>' . $strText . '</div>'; |
|
31 |
+ } else { |
|
32 |
+ $strText = '<' . strtolower($model->vr_dt_size) . '>' . $strText . '</' . strtolower($model->vr_dt_size) . '>'; |
|
33 |
+ } |
|
34 |
+ |
|
35 |
+ $template->set('text', $strText); |
|
36 |
+ return $template->getResponse(); |
|
37 |
+ } |
|
38 |
+} |