.. include:: /Includes.rst.txt .. _migrations-content-blocks-12: ====================== 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/content-blocks` ➡️ `friendsoftypo3/content-blocks` 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 :ref:`new structure `. .. code-block:: shell 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 :ref:`AssetPathViewHelper `. Now you can use the Core AssetViewHelpers and only use the custom ViewHelpers to build the path to your asset. .. code-block:: html New LanguagePathViewHelper ========================== We replaced the custom TranslateViewHelper with a new :ref:`LanguagePathViewHelper ` that is used to build the translation key. .. code-block:: html Record object ============= Content Blocks now uses the :php:`\TYPO3\CMS\Core\Domain\Record` under the hood. This has changed how some record attributes are accessed. * `{data._raw}` ➡️ `{data.rawRecord}` * `{data.typeName}` ➡️ `{data.recordType}` * `{data.tableName}` ➡️ `{data.mainType}` * `{data.creationDate}` ➡️ `{data.systemProperties.createdAt}` * `{data.updateDate}` ➡️ `{data.systemProperties.lastUpdatedAt}` * `{data.localizedUid}` ➡️ `{data.computedProperties.localizedUid}` Data processing =============== Content Blocks now uses the :php:`\TYPO3\CMS\Frontend\DataProcessing\RecordTransformationProcessor` under the hood. This has changed how some fields are transformed. Link ---- The type :ref:`Link ` field will now resolve to an object of type :php:`\TYPO3\CMS\Core\LinkHandling\TypolinkParameter`. Checks for existence need to be adjusted to check for the :html:`url` property instead. .. code-block:: html Folder ------ The type :ref:`Folder ` field will now resolve to a list of :php:`\TYPO3\CMS\Core\Resource\Folder` objects. .. code-block:: html FlexForm -------- New: Sub-fields of type FlexForm are now resolved as well. Groups ====== The property :yaml:`group` now works for both the `NewContentElementWizard` and for the record selector in the edit view. With this, the way to register groups has changed. .. note:: The group :yaml:`common` was renamed to :yaml:`default`. Before: .. code-block:: typoscript :caption: EXT:my_package/Configuration/page.tsconfig mod.wizards.newContentElement.wizardItems { my_group { header = LLL:EXT:my_package/Resources/Private/Language/Backend.xlf:content_group.my_group before = common } } After: .. code-block:: php :caption: EXT:my_package/Configuration/TCA/Overrides/tt_content.php