-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add content elements to their own group, limit images to image file extensions and require exactly one image. Improve backend preview templates
- Loading branch information
Showing
6 changed files
with
81 additions
and
43 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...s/packages/site_package_tutorial/13.4/src/Configuration/TCA/Overrides/tt_content.php.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; | ||
ExtensionManagementUtility::addTcaSelectItemGroup( | ||
'tt_content', | ||
'CType', | ||
'{{ package.extensionKey }}', | ||
'LLL:EXT:{{ package.extensionKey }}/Resources/Private/Language/locallang_be.xlf:content_element.group.{{ package.extensionKey }}', | ||
'after:default', | ||
); |
10 changes: 8 additions & 2 deletions
10
...es/site_package_tutorial/13.4/src/ContentBlocks/ContentElements/carousel/config.yaml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 35 additions & 29 deletions
64
...site_package_tutorial/13.4/src/ContentBlocks/ContentElements/carousel/language/labels.xlf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
<?xml version="1.0"?> | ||
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
<file datatype="plaintext" original="labels.xlf" source-language="en" date="2024-11-24T18:55:27+00:00" product-name="t3docs/carousel"> | ||
<header/> | ||
<body> | ||
<trans-unit id="title" resname="title"> | ||
<source>Carousel</source> | ||
</trans-unit> | ||
<trans-unit id="description" resname="description"> | ||
<source>See also https://getbootstrap.com/docs/5.0/components/carousel/</source> | ||
</trans-unit> | ||
<trans-unit id="carousel_items.label" resname="carousel_items.label"> | ||
<source>Carousel Items</source> | ||
</trans-unit> | ||
<trans-unit id="carousel_items.image.label" resname="carousel_items.image.label"> | ||
<source>Image</source> | ||
</trans-unit> | ||
<trans-unit id="carousel_items.header.label" resname="carousel_items.header.label"> | ||
<source>Header</source> | ||
</trans-unit> | ||
<trans-unit id="carousel_items.description.label" resname="carousel_items.description.label"> | ||
<source>Description</source> | ||
</trans-unit> | ||
<trans-unit id="previous.label" resname="previous.label"> | ||
<source>Previous</source> | ||
</trans-unit> | ||
<trans-unit id="next.label" resname="next.label"> | ||
<source>Next</source> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
<file datatype="plaintext" original="labels.xlf" source-language="en" date="2024-11-24T18:55:27+00:00" product-name="t3docs/carousel"> | ||
<header/> | ||
<body> | ||
<trans-unit id="title" resname="title"> | ||
<source>Carousel</source> | ||
</trans-unit> | ||
<trans-unit id="description" resname="description"> | ||
<source>See also https://getbootstrap.com/docs/5.0/components/carousel/</source> | ||
</trans-unit> | ||
<trans-unit id="carousel_items.label" resname="carousel_items.label"> | ||
<source>Carousel Items</source> | ||
</trans-unit> | ||
<trans-unit id="carousel_items.image.label" resname="carousel_items.image.label"> | ||
<source>Image</source> | ||
</trans-unit> | ||
<trans-unit id="carousel_items.header.label" resname="carousel_items.header.label"> | ||
<source>Header</source> | ||
</trans-unit> | ||
<trans-unit id="carousel_items.description.label" resname="carousel_items.description.label"> | ||
<source>Description</source> | ||
</trans-unit> | ||
<trans-unit id="previous.label" resname="previous.label"> | ||
<source>Previous</source> | ||
</trans-unit> | ||
<trans-unit id="next.label" resname="next.label"> | ||
<source>Next</source> | ||
</trans-unit> | ||
<trans-unit id="backend.itemCount" resname="backend.itemCount"> | ||
<source>Carousel with %s items</source> | ||
</trans-unit> | ||
<trans-unit id="backend.lastUpdated" resname="backend.lastUpdated"> | ||
<source>Last updated %s</source> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
34 changes: 23 additions & 11 deletions
34
...e_tutorial/13.4/src/ContentBlocks/ContentElements/carousel/templates/backend-preview.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
<f:asset.css identifier="content-block-t3docs-t3docs/carousel-be" href="{cb:assetPath()}/preview.css"/> | ||
<f:layout name="Preview"/> | ||
|
||
<div class="row"> | ||
<f:for each="{data.carousel_items}" as="item" iteration="iteration"> | ||
<div class="col"> | ||
<f:for each="{item.image}" as="image" iteration="iteration"> | ||
<f:image image="{image}" width="100"/><br/> | ||
</f:for> | ||
{item.header} | ||
</div> | ||
</f:for> | ||
</div> | ||
<f:section name="Header"> | ||
<f:variable name="itemCount"><f:count subject="{data.carousel_items}" /></f:variable> | ||
<div>{f:translate(key: '{cb:languagePath()}:backend.itemCount', arguments: {0: '{itemCount}'})}</div> | ||
</f:section> | ||
|
||
<f:section name="Content"> | ||
<div class="row"> | ||
<f:for each="{data.carousel_items}" as="item" iteration="iteration"> | ||
<div class="col"> | ||
<f:for each="{item.image}" as="image" iteration="iteration"> | ||
<f:image image="{image}" width="100"/><br/> | ||
</f:for> | ||
{item.header} | ||
</div> | ||
</f:for> | ||
</div> | ||
</f:section> | ||
|
||
<f:section name="Footer"> | ||
<f:variable name="lastUpdated"><f:format.date>{data.rawRecord.crdate}</f:format.date></f:variable> | ||
<div>{f:translate(key: '{cb:languagePath()}:backend.lastUpdated', arguments: {0: '{lastUpdated}'})}</div> | ||
</f:section> |
2 changes: 1 addition & 1 deletion
2
...s/site_package_tutorial/13.4/src/ContentBlocks/ContentElements/jumbotron/config.yaml.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters