Hallo zusammen,
hier der passende Artikel zu dem Vorreiter mit dem Template-Autoparser.
In TemplaVoila
<typoscript> <!--[CDATA[ # default TS #10= RECORDS #10.source.current=1 #10.tables = tt_content #10.wrap = <!--TYPO3SEARCH_begin----> | <!--TYPO3SEARCH_end--> # New TS 10 < lib.tv_content ]]></typoscript>
Das Haupt-Setup
# Display a tt_content record templavoila
###################################
lib.tv_content = COA
lib.tv_content {
10 = RECORDS
10 {
source.current = 1
tables = tt_content
wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
}
}
Auf der Seite (mit oder ohne Unterseiten)
# Display the current Record in templavoila
###################################
lib.myContent = COA
lib.myContent {
10 = RECORDS
10 {
source.current = 1
tables = tt_content
wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
}
}
# Display a tt_content record
###################################
lib.agbtext = RECORDS
lib.agbtext {
tables = tt_content
source = 138,157
dontCheckPid = 1
}
# Check form-data
###################################
lib.mySessionData = COA_INT
lib.mySessionData.10 = TEXT
lib.mySessionData.10.data = TSFE:fe_user|sesData|recs|ts|akz
lib.check = COA
lib.check {
10 < lib.mySessionData
10 {
if {
value.data = TSFE:fe_user|sesData|recs|ts|akz
equals = Akzeptieren
negate=1
}
# Zeige Default Content
10 < lib.agbtext
}
20 < lib.mySessionData
20 {
if {
value.data = TSFE:fe_user|sesData|recs|ts|akz
equals = Akzeptieren
}
# Zeige Content wenn es richtig war
10 < lib.myContent
}
}
# Display the Content
###################################
lib.tv_content < lib.check
Das Formular:
<div class="absatzDisclaimer">
<form method="post">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td style="width: 150px;">
<input type="submit" name="recs[ts][akz]" value="Nicht akzeptieren"></td>
<td style="width: 150px;">
<input type="submit" name="recs[ts][akz]" value="Akzeptieren"></td>
</tr>
</tbody>
</table>
</form></div>