.. ================================================== .. FOR YOUR INFORMATION .. -------------------------------------------------- .. -*- coding: utf-8 -*- with BOM. .. include:: ../../../Includes.txt .. _developers_bestpractise_newfield: 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. .. code:: php {data.bycycle_fitting} Registered field '''''''''''''''' A registered field must registered within your TypoScript (see below). .. code:: php {xBlogFieldBycycleFitting} 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: .. code:: php renderObj = FLUIDTEMPLATE renderObj { variables { registered_field_1 = ... registered_field_2 = ... ... See the TypoScript path for xBlogMainSingle below: .. code:: php 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 * :ref:`Developers > Good to know > Core ` Field definition '''''''''''''''' Example: Your field label is bycycle_fitting. A field definition can be: .. code:: php xBlogFieldBycycleFitting = TEXT xBlogFieldBycycleFitting { field = bycycle_fitting wrap =

|

} The complete code would be: .. code:: php plugin.tx_xblog_pi1.settings.views.single.content.30.30.single.20 { xBlogMainSingle { cObject { renderObj { variables { xBlogFieldBycycleFitting = TEXT xBlogFieldBycycleFitting { field = bycycle_fitting wrap =

|

} ...