Typo3 - Templates mit Fluid: Unterschied zwischen den Versionen
Aus Wikizone
| Zeile 15: | Zeile 15: | ||
=== Unterschiede in der Vorgehensweise === | === Unterschiede in der Vorgehensweise === | ||
| − | + | ==== Old School mit Markern und Subparts ==== | |
| + | |||
HTML: | HTML: | ||
<pre> | <pre> | ||
| Zeile 38: | Zeile 39: | ||
</pre> | </pre> | ||
| + | ==== Mit Fluid ==== | ||
HTML mit Fluid Variable "content" | HTML mit Fluid Variable "content" | ||
<pre> | <pre> | ||
<div id =“content“> | <div id =“content“> | ||
| − | {content} | + | {content} |
</div> | </div> | ||
</pre> | </pre> | ||
| Zeile 47: | Zeile 49: | ||
TypoScript mit Fluidtemplate-Objekt statt Template-Objekt | TypoScript mit Fluidtemplate-Objekt statt Template-Objekt | ||
| + | |||
<pre> | <pre> | ||
page = PAGE | page = PAGE | ||
| + | |||
page.10 = FLUIDTEMPLATE | page.10 = FLUIDTEMPLATE | ||
page.10 { | page.10 { | ||
| − | + | file = fileadmin/templates/fluid/1col.html | |
| − | + | partialRootPath = fileadmin/templates/fluid/partials/ | |
| − | + | layoutRootPath = fileadmin/templates/fluid/layouts/ | |
| − | + | variables { | |
| − | ... | + | content_normal < styles.content.get |
| + | content_normal.select.where = colPos = 0 | ||
| + | content_left < styles.content.get | ||
| + | content_left.select.where = colPos = 1 | ||
| + | content_right < styles.content.get | ||
| + | content_right.select.where = colPos = 2 | ||
| + | |||
| + | } | ||
| + | } | ||
</pre> | </pre> | ||
== Fluid Snippets == | == Fluid Snippets == | ||
Version vom 5. Dezember 2013, 15:50 Uhr
Fluid soll dafür sorgen, daß die Ausgabe Logik mit ins Template kommt. Dadurch soll das Arbeiten übersichtlicher werden.
Links
http://blog.sbtheke.de/web-development/typo3-verschiedene-seiten-templates-mit-fluid-und-be-layout
http://t3n.de/magazin/seitentemplates-fluid-226788/
Fluid Quickstart
Vorbereitung
Extensions fluid und extbase müssen installiert sein.
Einführung in Fluid Templates
- Bisher nur für Extensions
- Ab TYPO3 4.5 FLUIDTEMPLATE TypoScript-Objekt. Dieses steht für Templates zur Verfügung und nutzt im Hintergrund das neu eingeführte Fluid-Standaloneview.
Unterschiede in der Vorgehensweise
Old School mit Markern und Subparts
HTML:
<!-- ###DOCUMENT begin --> <div id =“content“> ###CONTENT### </div> <!-- ###DOCUMENT end -->
TypoScript:
page = PAGE
page.10 = TEMPLATE
page.10 {
template = FILE
template.file = fileadmin/site/template/tpl_main.html
workOnSubpart = DOCUMENT
marks {
CONTENT < styles.content.get
...
Mit Fluid
HTML mit Fluid Variable "content"
<div id =“content“>
{content}
</div>
TypoScript mit Fluidtemplate-Objekt statt Template-Objekt
page = PAGE
page.10 = FLUIDTEMPLATE
page.10 {
file = fileadmin/templates/fluid/1col.html
partialRootPath = fileadmin/templates/fluid/partials/
layoutRootPath = fileadmin/templates/fluid/layouts/
variables {
content_normal < styles.content.get
content_normal.select.where = colPos = 0
content_left < styles.content.get
content_left.select.where = colPos = 1
content_right < styles.content.get
content_right.select.where = colPos = 2
}
}