TemplaVoila extends the Data Structure XML with a set of tags which defines two things related to TemplaVoila:
Mapping: Definition of mapping rules, descriptions, sample data, and field type preset
Rendering: Definition of TypoScript code, Object Path, processing flags and constants
“Array” Elements:
Element | Description | Sub-elements |
|---|---|---|
<[application tag]> | In this case the application tag is “<tx_templavoila>” | <title> <description> <tags> <sample_data> <sample_order> <eType> <TypoScriptObjPath> <TypoScript> <proc> <ruleConstants> <ruleRegEx> <ruleDefaultElements> <langOverlayMode> |
<ROOT><tx_templavoila> | For <ROOT> elements in the DS | <title> <description> <pageModule> |
<pageModule> | A bunch of config options which take influence on the rendering in the page module. | <displayHeaderFields> <titleBarColor> |
<sample_data> | Sample data, defined in numeric array. Sample data is selected randomly from these options | <n[0-x]> |
<sample_order> | For <section>s: Defines a set of array objects to display as sample data. Each value in this numerical array points to a fieldname in the object <el> array. | <n[0-x]> |
<TypoScript_constants> | <[constant_name]> | |
<proc> | Processing options (during rendering) | <stdWrap> <int> <HSC> |
“Value” Elements:
Element | Format | Description |
|---|---|---|
<meta><sheetSelector> | string | Defining a file/class with PHP code to evaluation sheet selection in frontend. Its a getUserObject reference a la “EXT:user_myext/class.user_myext_selectsheet.php:&user_myext_selectsheet” where the class user_myext_selectsheet contains a function, selectSheet(), which returns the sheet key, eg. “sDEF” for default sheet. Notice about using sheets in frontend rendering (pi1): This feature is fairly advanced and still needs some development and documentation. Here are some points to observe:
|
<title> | string | The title displayed in the mapping view |
<description> | string | Mapping instructions / description, shown in mapping view. |
<tags> | string | commalist of tag rules. A tag rule is defined as [tagname]:[mapping-mode]:[attribute] Examples are:
|
<eType> | string | Value pointing to a TCEforms preset. Used for building of Data Structures with templavoila. Automatically set and controlled. This tag only used internally by the mapping tool. |
<oldStyleColumnNumber> | integer | By setting this tag to an integer value (usually between 0 and 3), you define to which tt_content column number this field relates. This information is used by the list module, frontend editing and all other places which work with the older column paradigm. If you want to convert a pre-TemplaVoila site to a TemplaVoila site with the migration wizard you also have to make sure setting oldStyleColumnNumber tags for your content areas. Note: Each value can only be used once in a data structure and this usage makes only sense in page templates! Background information: Before TemplaVoila existed, the content on a page was arranged by assigning each content element to a certain column id. By default four columns were available: “Normal” (id=0), “Left” (id=1), “Right” (id=2) and “Border” (id=3). Some parts of TYPO3 and some extensions are not aware of the different way TemplaVoila structures content. If you create or move a content element with the List module, the element possibly does not appear at the position where you expect it, because the list module doesn't know which content area reflects the “Normal” column. Example: <T3DataStructure> <ROOT> <el> <field_maincontent> <tx_templavoila> <oldStyleColumnNumber>0</oldStyleColumnNumber> ... |
<TypoScriptObjPath> | string | TypoScript object path pointing to a TypoScript Template Content Object which will render the content represented by the element. Very useful if you want to insert a menu which is defined by eg. “lib.myMenu” in the TypoScript Template of a website. |
<TypoScript> | string | TypoScript content. Constants can be inserted
General example: <TypoScript> <![CDATA[ 10 = USER 10.userFunc = user_3dsplm_pi2->testtest 10.imageConfig {file.import.current = 1 file.width = 100 } ]]> </TypoScript> Access other fields in the same data structure: <TypoScript> 10 = TEXT 10.field = field_myotherfield </TypoScript> Display the page title: <TypoScript> 10 = TEXT 10.data = page:title </TypoScript> |
<[constant_name]> | string | A local TypoScript constant which can be inserted by {$[constant_name]} in <TypoScript> (see above) Instead of setting a plain value you can also reference object path values from the sites TypoScript template by inserting a value like “{$lib.myConstant}”. Notice, the value will come from the Templates Setup field. Example: <TypoScript_constants> <backGroundColor>red</backGroundColor> <fontFile>{$_CONSTANTS.resources.fontFile}</fontFile></TypoScript_constants> Here “_CONSTANTS.resources.fontFile” must be an object path with a value in the TypoScript template of the website! |
<int> | boolean, 0/1 | Pass through intval() before output |
<HSC> | boolean, 0/1 | Pass through htmlspecialchars() before output |
<stdWrap> | string | StdWrap properties as TypoScript, eg: <proc> <stdWrap> trim = 1 br = 1 </stdWrap> </proc> |
<langOverlayMode> | string, keyword | Setting the mode for content fallback when <meta><langChildren> and other languages are used in flexforms. Normally inheritance from default language is enabled by default and globally disabled by the TypoScript setting “dontInheritValueFromDefault” if needed. However through the Data Structure and TO / Local Processing XML you can overrule this per-field by this keyword. In any case it only affects values from other languages than default and only if <langChildren> is enabled (thus using “vDEF” and sibling fields named “vXXX” for localization). Keywords: ifFalse - Content is inherited if it evaluates to false in PHP (meaning that zero and blank string falls back) ifBlank - Content is inherited if it matched a blank string (trimmed) never - Content is never inherited from default language! removeIfBlank - If the value of this field is blank then the whole group of fields (element) is removed! This is a way of removing single elements for localizations in <langChildren>=1 constructions instead of inheriting content from default language. [default] - If no keyword matches it uses the global mode. |
<displayHeaderFields> | string | A list of page-related fields which should be displayed as a header in the edit page view of the page module. By now, only table “page” is allowed / makes sense. Note: This tag only takes effect when used in the top-level <tx_templavoila> section, ie. one level below the <ROOT> tag.
Example: <T3DataStructure> <ROOT> <tx_templavoila> <pageModule> <displayHeaderFields> pages.keywords pages.mycustomfield </displayHeaderFields> </pageModule> ... |
<titleBarColor> | color | If you want to help your editors determining which data structure is used for the page they are currently working on, you may specify a color by using this tag. The title bar at the very top of the edit page screen will be displayed in that color. You may use any value which is allowed in CSS (ie. “red” as well as “#FC2300” etc.) Note: This tag only takes effect when used in the top-level <tx_templavoila> section, ie. one level below the <ROOT> tag.
Example: <T3DataStructure> <ROOT> <tx_templavoila> <pageModule> <titleBarColor>orange</titleBarColor> ... |
Extensions to tags in the Data Structure | ||
<[field-name]><type> | string | In the Data Structure only “array” or blank makes sense. However for TemplaVoila there is additional values possible, “attr” and “no_map”. This is a complete TemplaVoila related overview of the <type> / <section> meanings:
|
TemplaVoila is compatible with definition of sheets. In that case a sheet <ROOT> element is shown in the mapping structure containing each sheet as <ROOT> elements under it.
Note: This feature is experimental and can be changed in future. All users are warned: use it at your own risk! This notice will be removed when this feature becomes stable.
To access “parent” record from “tt_content” or “pages” table in the <TypoScript> section of a field, developer can use special registers. These registers defined only when <TypoScript> section is executed. The following example shows how to use these registers:
<TypoScript>10 = TEXT10.data = register:tx_templavoila_pi1.parentRec.uid10.wrap = “uid” field of parent record is |</TypoScript>
Thus any field of parent record is defined as tx_templavoila_pi1.parentRec.XXX register, where XXX is replaced by a field name from the corresponding table.
Notice that these registers are undefined for static data structures because static data structures do not have associated parent record. If reference to tx_templavoila_pi1.parentRec.XXX appears in the static data structure, result is undefined.
