.. include:: Images.txt
.. ==================================================
.. FOR YOUR INFORMATION
.. --------------------------------------------------
.. -*- coding: utf-8 -*- with BOM.
.. ==================================================
.. DEFINE SOME TEXTROLES
.. --------------------------------------------------
.. role:: underline
.. role:: typoscript(code)
.. role:: ts(typoscript)
:class: typoscript
.. role:: php(code)
Setting up a Data Structure XML file for Template Objects mapping
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In “mininews” the data structure that is used for the mapping of
templates is found in the file “mininews/template\_datastructure.xml”.
The contents look like this:
::
EXT:mininews/template_datastructure_arc.xml
SINGLE DISPLAY
Select the HTML element which is the container of the
single display of a news article:
div:inner
array
Date
News date
*:inner
6th August 10:34
29/12 2003
Header
Header field.
*:inner
People on mars!
Snow in Sydney
Teaser
Teaser field.
*:inner
Capthurim Chanaan vero genuit Sidonem primogenitum et
Heth Iebuseum quoque
Bodytext
Bodytext field
*:inner
Filii Ham Chus et Mesraim Phut et Chanaan filii autem Chus Saba et Evila Sabatha et Rechma et Sabathaca porro filii Rechma Saba et Dadan Chus autem genuit Nemrod iste coepit esse potens in terra Mesraim vero genuit Ludim et Anamim et Laabim et Nepthuim Phethrosim quoque et Chasluim de quibus egressi sunt Philisthim et.
Capthurim Chanaan vero genuit Sidonem primogenitum et Heth Iebuseum quoque et Amorreum et Gergeseum Evheumque et Aruceum et Asineum Aradium quoque et Samareum et Ematheum filii Sem Aelam et Assur et Arfaxad et Lud et Aram et Us et Hul et Gothor et Mosoch Arfaxad autem genuit Sala qui et ipse genuit Heber porro Heber nati sunt duo filii nomen uni Phaleg quia in diebus eius divisa est terra et nomen fratris eius Iectan Iectan autem genuit Helmodad et Saleph et Asermoth et Iare Aduram quoque et Uzal et Decla Ebal etiam et Abimahel et Saba necnon et Ophir et Evila et Iobab omnes isti filii Iectan Sem Arfaxad Sale.
]]>
attr
"Back" URL.
Map to a-tags href-attribute of the link back to
archive listing.
a:attr:href
javascript:alert('You click this link!');
FRONTPAGE LISTING
Select the HTML element which is the container of the
frontpage listing display of a news articles:
div:inner
array
array
Archive Listing container
div,table:inner
array
Element Container, Even
*:outer
Date
News date
*:inner
6th August 10:34
29/12 2003
Header
Header field.
*:inner
People on mars!
Snow in Sydney
Teaser
Teaser field.
*:inner
Capthurim Chanaan vero genuit Sidonem primogenitum et
Heth Iebuseum quoque
attr
"MORE" URL.
Map to a-tags href-attribute of the link pointing
to the archive!
a:attr:href
javascript:alert('You click this link!');
If you study this long codelisting you will find that it only
configures the DS for the templates “SINGLE DISPLAY” and “FRONTPAGE
LISTING” - the “ARCHIVE LISTING” is actually found in another file
referred to by this line:
::
EXT:mininews/template_datastructure_arc.xml
You can study the contents of this file by yourself.
Anyways, the question remains: How does mininews configure that this
XML file should be available for Template Objects to point to? This is
found in ext\_tables.php:
::
// Adding datastructure for Mininews:
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['templavoila']['staticDataStructures'][]=array(
'title' => 'Mininews Template',
'path' => 'EXT:'.$_EXTKEY.'/template_datastructure.xml',
'icon' => '',
'scope' => 0,
);
$\_EXTKEY contains the value “mininews” as usual in a ext\_tables.php
file for an extension.
By this configuration the DS will appear in the Data Structure
selector box:
|img-17|
At this point we have:
- FlexForm configuration needed to select template record in the “Insert
Plugin” type Content Element
- A Data Structure (DS) in an XML file which can be used for mapping a
template HTML-file to the DS.
- You should also have an example template-HTML file which can
demonstrate the mapping of your DS.
All that is left is to actually use the template in the plugin.