2.4
Content Blocks version 2.4 adds a collection of small new features.
Feature
Identifier alias for fields
You can now define an
alias for fields, which will then be used instead
of the
identifier in your Fluid templates. This has two main advantages:
- You are not forced to use snake_case in Fluid, just because it is better suited for database column names.
- You can use semantic names when re-using shared, generic fields in the context of your Content Block.
name: example/cta
fields:
- identifier: header
alias: title
Field Type SelectText
A new field type SelectText is added. This
new type allows to have a select field with exclusively text values. The
database column will also have type
varchar, instead of
longtext.
name: example/select-text
fields:
- identifier: select_text
type: SelectText
items:
- label: 'The first'
value: 'first'
- label: 'The second'
value: 'second'
New option hideInUid for Record Types
It is now possible to explicitly hide Record Types in the record overview
by defining
hide. This is already done automatically when
the Record Type is used as a child item in Collections.
New automatic language keys
New automatic language keys are added, which can now be used in the labels.xlf file:
placeholder(for types with input field: Text, Textarea, Email, ...)label(for Checkbox withChecked render)Type: checkbox Labeled Toggle label(for Checkbox withUnchecked render)Type: checkbox Labeled Toggle
See here for more information.
Site and Site Settings available in backend previews
You have now access to the
site and
site variables in
your backend-preview.html templates. Having these, you can now display your
previews depending on the current site and settings. This is especially useful
if you define special colors in your theme and want to load CSS variables into
your templates.
Generate frontend and backend preview templates via CLI
Two new commands allow you to generate starter Fluid templates for a Content Block directly from the command line:
content-generatesblocks: generate: frontend templates/frontend. fluid. html content-generatesblocks: generate: backend- preview templates/backend- preview. fluid. html
Both commands require the Content Block name as an argument and will not
overwrite an existing file unless the
-- option is given.
vendor/bin/typo3 content-blocks:generate:frontend example/my-block
vendor/bin/typo3 content-blocks:generate:backend-preview example/my-block
See Generate Frontend Template Command and Generate Backend Preview Template Command for details.