... und dann hab ich es kapiert (hoffe ich) 😃
Ich habe mehrere Tutorials mehr oder weniger durchgearbeitet. Nach MTB 1 habe ich sogar den Auto-Parser installiert. Manchmal ist mir jedoch nicht klar, ob die Typo-Script Codes, die ich hier im Forum finde, dann für mich noch relevant sind, oder nicht. Irgendwie macht dieser Auto-Parser doch ziemlich viel allein, wobei mir noch nicht ganz klar ist, wann ich doch etwas ergänzen muß. Ich will einfach vermeiden, daß ich unnötigen Code aus den verschiedenen Tutorials verwende, wenn der Auto-Parser ihn nicht braucht.
Im Moment versuche ich die Startseite von: http://www.bogx.de anzupassen. Insbesonders geht es hier im Moment um die Kreise mit den Links. Diese Kreise sind in divs definiert, um die Position genau zuzuweisen. Außerdem habe ich jetzt nachträglich die Kreise in eine Tabelle gesetzt, damit ich den td´s einen ID-Namen geben kann. Der Auto-parser erkennt die Subparts, setzt aber die ID=411. Es handelt sich dabei um den ersten Kreis, den ich in Typo als Inhalt angegeben habe.
Wie kann ich jetzt aber diese Subparts ansprechen? Muß ich im HTML-Template die Inhalte (Kreise) löschen und nochmals extra einen Marker setzen. Im Moment sieht es so aus, daß ich einen Kreis (Entwicklung) als Content in Typo3 einfügen konnte. Jeder weitere Seiteninhalt würde aber zusätzlich unten dran geknallt. Außerdem erscheint bei jedem SubPart der gleich Inhalt, obwohl ich noch nirgends die anderen Kreise eingesetzt habe. Im Quelltext der Seite wird immer automatisch der gleiche Inhalt (Kreis Entwicklung) gesetzt. Das Ergebnis sieht man unter: http://217.160.162.214/cms35/index.php?id=390.
Hier noch meine Setups vom MTB1:
Setup des Templates:
# Default PAGE object:
page = PAGE
page.typeNum = 0
# Copying the content from TEMPLATE for <body>-section:
page.10 < temp.mainTemplate
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10 < temp.headTemplate
Setup MainTemplate cObject (Im File Template Storage)
# Menu 1 cObject
temp.menu_1 = HMENU
# First level menu-object, textual
temp.menu_1.1 = TMENU
temp.menu_1.1 {
# Normal state properties
NO.allWrap = <div class="menu1-level1-no"> | </div>
# Enable active state and set properties:
ACT = 1
ACT.allWrap = <div class="menu1-level1-act"> | </div>
}
# Second level menu-object, textual
temp.menu_1.2 = TMENU
temp.menu_1.2 {
# Normal state properties
NO.allWrap = <div class="menu1-level2-no"> | </div>
# Enable active state and set properties:
ACT = 1
ACT.allWrap = <div class="menu1-level2-act"> | </div>
}
# Main TEMPLATE cObject for the BODY
temp.mainTemplate = TEMPLATE
temp.mainTemplate {
# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template =< plugin.tx_automaketemplate_pi1
# Select only the content between the <body>-tags
workOnSubpart = DOCUMENT_BODY
# Substitute the ###menu_1### subpart with dynamic menu:
subparts.menu_1 < temp.menu_1
# Substitute the ###content### subpart with some example content:
subparts.content < styles.content.get
# Substitute the ###entwicklung### subpart with some example content:
subparts.entwicklung < styles.content.get
# Substitute the ###webdesign### subpart with some example content:
subparts.webdesign < styles.content.get
# Substitute the ###onlineshops### subpart with some example content:
subparts.onlineshops < styles.content.get
# Substitute the ###vollservice### subpart with some example content:
subparts.vollservice < styles.content.get
# Substitute the ###grafik### subpart with some example content:
subparts.grafik < styles.content.get
}
# Main TEMPLATE cObject for the HEAD
temp.headTemplate = TEMPLATE
temp.headTemplate {
# Feeding the content from the Auto-parser to the TEMPLATE cObject:
template =< plugin.tx_automaketemplate_pi1
# Select only the content between the <head>-tags
workOnSubpart = DOCUMENT_HEADER
}
Und noch der Auto-Parser: (Menu 1 lasse ich weg, da es funktioniert)
# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
# Read the template file:
content = FILE
content.file = fileadmin/template/main/template_1.html
# Here we define which elements in the HTML that
# should be wrapped in subpart-comments:
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title
TD.all = 1
}
# Prefix all relative paths with this value:
relPathPrefix = fileadmin/template/main/
}
Ich glaube, wenn ich dies kapiert habe, dann werde ich wunderschöne Zeiten mit Typo3 erleben ;-).
Gruß
Aragorn