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.
Basic Configuration¶
Configure a base FCE renderer USER object¶
A common way to use this extension is to create another extension where you put the templates and TypoScript for your content elements (we call that a site extension).
For this example we assume an additional extension named "My Content Elements" with the extension key contentelements
.
The following definition should go into the Typoscript setup and provides a base definition in lib.fceRenderer
that
can be copied to the individual content type definitions:
lib.fceRenderer = USER
lib.fceRenderer {
userFunc = Tx_FluidFce_Content_FceRenderer->render
extbase.pluginName = Contentelements
flexformFields = pi_flexform
partialRootPath = EXT:contentelements/Resources/Private/Partials
layoutRootPath = EXT:contentelements/Resources/Private/Layouts
}
Configure the content element rendering¶
The idea for custom content elements is to use a new tt_content
type, which can be configured to show only some of
the available fields or where a special Flexform definition can be configured to add new fields to a content element.
This is a simple rendering configuration, assuming that we added a new content element type contentelements_teaserBox
:
tt_content {
contentelements_teaserBox < lib.fceRenderer
contentelements_teaserBox.file = EXT:contentelements/Resources/Private/Templates/TeaserBox.html
}
TCA¶
This is an example configuration to add a new content element type contentelements_teaserBox
by extending the TCA
configuration. Add the following configuration to your ext_tables.php
:
# Add backend element
t3lib_extMgm::addPlugin(array('Teaser Box', 'contentelements_teaserBox'), 'CType');
# Define available fields
$TCA['tt_content']['types']['contentelements_teaserBox']['showitem'] = '
--palette--;LLL:EXT:cms/locallang_ttc.xml:palette.general;general,
header;LLL:EXT:cms/locallang_ttc.xml:palette.header,
bodytext;;9;richtext:rte_transform[flag=rte_enabled|mode=ts_css];,
image,
header_link,
--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.appearance,
--palette--;LLL:EXT:cms/locallang_ttc.xml:palette.frames;frames,
--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.access,
--palette--;LLL:EXT:cms/locallang_ttc.xml:palette.visibility;visibility,
--palette--;LLL:EXT:cms/locallang_ttc.xml:palette.access;access,
--div--;LLL:EXT:cms/locallang_ttc.xml:tabs.extended,
--div--;sys_language_uid,
l18n_parent
';
TsConfig¶
To show the content element in the "New content element" wizard, the following TS Config can be set:
mod.wizards.newContentElement.renderMode = tabs
mod.wizards.newContentElement.wizardItems.common {
elements.contentelements_teaserBox {
icon = /typo3conf/ext/contentelements/Resources/Public/Icons/standard-fce.png
title = Teaser Box
description = Box with picture, header, text and an optional link
tt_content_defValues {
CType = contentelements_teaserBox
}
}
show := addToList(contentelements_teaserBox)
}
Typoscript Reference¶
This is a full reference of all configuration options for the FceRenderer
class, most of the original
FLUIDTEMPLATE
options apply and are used the same way:
Property
file
Data type
string / stdWrap
Description
Path to the fluid template file
Property
layoutRootPath
Data type
string / stdWrap
Description
Root path for Fluid layouts
Property
partialRootPath
Data type
string / stdWrap
Description
Root path for Fluid partials
Property
format
Data type
string / stdWrap
Description
Sets the format of the current request.
Property
extbase.pluginName
Data type
string / stdWrap
Description
Override the Extbase plugin name for Fluid
Property
extbase.controllerExtensionName
Data type
string / stdWrap
Description
Override the Extbase controller extension name for Fluid
Property
extbase.controllerName
Data type
string / stdWrap
Description
Override the Extbase controller name for Fluid
Property
extbase.controllerActionName
Data type
string / stdWrap
Description
Override the Extbase controller action name for Fluid
Property
flexformFields
Data type
list of fields / stdWrap
Description
This is a comma separated list of flexform fields in the tt_content
table that should be used to extract
variables for a content element. Normally it's pi_flexform
. Set it if you want to use additional fields
from flexforms.
Property
variables
Data type
(array of cObjects)
Description
Sets additional variables that should be available in the Fluid template. The keys are the variable names in Fluid.
In contrast to the original FLUIDTEMPLATE
object, everything in data
(the current record) will be available
as a variable in Fluid.
Property
stdWrap
Data type
stdWrap