feat: add content elements, change backend preview
All checks were successful
Build / build (push) Successful in 4m0s
Build / deploy-stage (push) Successful in 2m50s
Build / switch-stage (push) Successful in 1m57s

This commit is contained in:
2024-12-15 19:08:26 +01:00
parent 1076fe6447
commit 696881e4f8
15 changed files with 137 additions and 26 deletions

View File

@@ -0,0 +1 @@
/* CSS for text content element */

View File

@@ -0,0 +1,14 @@
name: cloonar/text
typeName: cloonar_text
group: default
prefixFields: true
prefixType: full
label: LLL:EXT:base/ContentBlocks/ContentElements/text/language/labels.xlf:text.title
description: LLL:EXT:base/ContentBlocks/ContentElements/text/language/labels.xlf:text.description
fields:
- identifier: header
useExistingField: true
- identifier: bodytext
type: Textarea
enableRichtext: true
useExistingField: true

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.0">
<file source-language="en" datatype="plaintext" original="messages">
<body>
<trans-unit id="title">
<source>Text</source>
</trans-unit>
<trans-unit id="description">
<source>A text element featuring a headline (H2) and a rich-text body field.</source>
</trans-unit>
</body>
</file>
</xliff>

View File

@@ -0,0 +1,22 @@
<html
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers"
data-namespace-typo3-fluid="true"
>
<f:layout name="Preview"/>
<f:section name="Header">
<be:link.editRecord uid="{data.uid}" table="{data.mainType}">
<f:if condition="{data.header}">
<f:then><strong>{data.header}</strong></f:then>
</f:if>
</be:link.editRecord>
</f:section>
<f:section name="Content">
<f:if condition="{data.bodytext}">
<p>
<f:format.crop maxCharacters="80">
<f:format.stripTags>{data.bodytext}</f:format.stripTags>
</f:format.crop>
</p>
</f:if>
</f:section>
</html>

View File

@@ -0,0 +1,11 @@
<f:layout name="Default" />
<f:section name="Main">
<f:if condition="{data.header}">
<f:then><h2>{data.header}</h2></f:then>
</f:if>
<f:if condition="{data.bodytext}">
<f:then>
<div class="text-bodytext"><f:format.html>{data.bodytext}</f:format.html></div>
</f:then>
</f:if>
</f:section>