DEPRECATION WARNING
This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.
Register a new field¶
Steps¶
- Place your field in the fluid template
- Register a field in TypoScript (optional)
Fluid Template¶
Sample code for the fluid template and a new field bycycle_fitting from an extension like tx_myextension.
Non registered field¶
Nothing to do in TypoScript.
<f:format.html>{data.bycycle_fitting}</f:format.html>
Registered field¶
A registered field must registered within your TypoScript (see below).
<f:format.html>{xBlogFieldBycycleFitting}</f:format.html>
TypoScript¶
If you like to work with registered fields in your fluid templates, you have to register these fields within TypoScript. See the workflow below.
Registered fields are part of the TypoScript FLUIDTEMPLATE.
Each of the three “core” registers - xBlogMainList, xBlogMainSingle, xBlogMini - has an element renderObj:
renderObj = FLUIDTEMPLATE
renderObj {
variables {
registered_field_1 = ...
registered_field_2 = ...
...
See the TypoScript path for xBlogMainSingle below:
plugin.tx_xblog_pi1.settings.views.single.content.30.30.single.20 {
xBlogMainSingle {
cObject {
renderObj {
variables =
If you don’t know, how to find one of the three core registers - xBlogMainList, xBlogMainSingle, xBlogMini -, please refer to
Field definition¶
Example: Your field label is bycycle_fitting.
A field definition can be:
xBlogFieldBycycleFitting = TEXT
xBlogFieldBycycleFitting {
field = bycycle_fitting
wrap = <p class="fittings">|</p>
}
The complete code would be:
plugin.tx_xblog_pi1.settings.views.single.content.30.30.single.20 {
xBlogMainSingle {
cObject {
renderObj {
variables {
xBlogFieldBycycleFitting = TEXT
xBlogFieldBycycleFitting {
field = bycycle_fitting
wrap = <p class="fittings">|</p>
}
...