Content Blocks for v12
With the release of Content Blocks 1.0.0 some things changed under the hood, which require migration in your Fluid templates. Also, the folder structure changed as well as usage of ViewHelpers.
New composer name
The composer name has changed.
contentblocks/
➡️ friendsoftypo3/
Please migrate, as the old package is abandoned.
New folder structure
There is a migration wizard to rename your Content Blocks folders and files to the new structure.
typo3 upgrade:run contentBlocksFolderStructureMigration
Ensure the extension with the old Content Block structure is loaded in the system before running this wizard.
Warning
On case-insensitive file systems like Windows or MacOS have, the renaming
of folder Assets
to assets
won't be registered in git. This needs to
be commited on a case-sensitive file system e.g. inside your ddev container.
New AssetPathViewHelper
We replaced the custom AssetViewHelpers with a new AssetPathViewHelper. Now you can use the Core AssetViewHelpers and only use the custom ViewHelpers to build the path to your asset.
<!-- Before -->
<cb:asset.css identifier="cbAccordionCssBackend" file="EditorPreview.css"/>
<!-- After -->
<f:asset.css identifier="cbAccordionCssBackend" href="{cb:assetPath()}/EditorPreview.css"/>
New LanguagePathViewHelper
We replaced the custom TranslateViewHelper with a new LanguagePathViewHelper that is used to build the translation key.
<!-- Before -->
<cb:translate key="readmore"/>
<!-- After -->
<f:translate key="{cb:languagePath()}:readmore"/>
Record object
Content Blocks now uses the \TYPO3\
under the hood.
This has changed how some record attributes are accessed.
{data._
➡️raw} {data.
raw Record} {data.
➡️type Name} {data.
record Type} {data.
➡️table Name} {data.
main Type} {data.
➡️creation Date} {data.
system Properties. created At} {data.
➡️update Date} {data.
system Properties. last Updated At} {data.
➡️localized Uid} {data.
computed Properties. localized Uid}
Data processing
Content Blocks now uses the \TYPO3\
under the hood. This has changed how some fields are transformed.
Link
The type Link field will now resolve to an object of
type \TYPO3\
. Checks for existence
need to be adjusted to check for the url
property instead.
<!-- Before -->
<f:if condition="{data.link_field}">
<!-- -->
</f:if>
<!-- After -->
<f:if condition="{data.link_field.url}">
<!-- -->
</f:if>
Folder
The type Folder field will now resolve to a list of
\TYPO3\
objects.
<!-- Before -->
<f:for each="{data.folder}" as="folder">
<f:for each="{folder}" as="image">
<f:image image="{item}" />
</f:for>
</f:for>
<!-- After -->
<f:for each="{data.folder}" as="folder">
<f:for each="{folder.files}" as="image">
<f:image image="{item}" />
</f:for>
</f:for>
FlexForm
New: Sub-fields of type FlexForm are now resolved as well.
Groups
The property group
now works for both the New
and
for the record selector in the edit view. With this, the way to register groups
has changed.
Note
The group common
was renamed to default
.
Before:
mod.wizards.newContentElement.wizardItems {
my_group {
header = LLL:EXT:my_package/Resources/Private/Language/Backend.xlf:content_group.my_group
before = common
}
}
After:
<?php
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItemGroup(
'tt_content', // table
'CType', // typeField
'my_group', // group
'LLL:EXT:my_package/Resources/Private/Language/Backend.xlf:content_group.my_group', // label
'before:default', // position
);
Public assets
The assets
folder of your Content Block is now symlinked to the extension's
Resources/
folder.