1.1
Features
Backend Preview areas
It is now possible to adjust the header and footer for backend previews of Content Elements:
<f:layout name="Preview"/>
<f:section name="Header">
<div>My header</div>
</f:section>
<f:section name="Content">
<f:asset.css identifier="my-backend-styles" href="{cb:assetPath()}/preview.css"/>
<div>My content</div>
</f:section>
<f:section name="Footer">
<div>My footer</div>
</f:section>
Content Block skeleton
It is now possible to define a "skeleton" for your Content Blocks. To do this
create a folder called content-
in your project root. This
folder may contain default templates or assets for one or more Content Types. It
is used as a base when creating new types with the make:
command. In order to add a skeleton for Content Elements, create a folder called
content-
within that directory. Then, the structure is identical to
your concrete Content Block as you know it. You may place any files there. They
will simply be copied when a new Content Block is created. It is not possible to
define language/
or config.
this way, as they are dynamically
generated based on your arguments.
In case you want to name the skeleton folder differently or place it somewhere
else, you can override the default folder by providing the option
--
with a relative path to your current working directory.
vendor/bin/typo3 make:content-block --skeleton-path="my-alternative-skeleton-path"
Make command defaults
It is now possible to define default options for the make command via a yaml
config file. By default, the command looks for a file called
content-
in the current working directory. The location and name
can be overridden with the --
option.
vendor/bin/typo3 make:content-block --config-path="some-folder/my-config.yaml"
An example yaml config file contents may look like this:
vendor: nh
extension: content_blocks_examples
content-type: record-type
skeleton-path: folder1/content-block-skeletons
This config sets defaults for vendor
, skeleton-
,
extension
and content-
. These are all possible options right
now.
Now, whenever you run this command, these options will be set by default. This
does not mean, the questions for these options will be skipped, only that they
are the default value, if you just press Enter
without any input. They will
be visible in brackets at the very right [default value]
.
Field Type SelectNumber
A new field type SelectNumber is added. This
new type allows to have a select field with exclusively integer values. The
database column will also have type int
, which saves precious row size.
name: example/select-number
fields:
- identifier: select_number
type: SelectNumber
items:
- label: 'The first'
value: 1
- label: 'The second'
value: 2
Deprecations
Backend Preview
Backend previews for Content Elements must use the new layout Preview
now. Content Blocks will fall back to the old behavior, if the layout is omitted
and will log a deprecation-level log entry.
Before:
<f:asset.css identifier="my-backend-styles" href="{cb:assetPath()}/preview.css"/>
<div>My content</div>
After:
<f:layout name="Preview"/>
<f:section name="Content">
<f:asset.css identifier="my-backend-styles" href="{cb:assetPath()}/preview.css"/>
<div>My content</div>
</f:section>