Hallo Daniel!
Danke für Deine Nachricht!
Meinst Du mit TS (was wohl TypoScript heißen soll?) das Template?
Gruß,
blueberry
Hallo Daniel!
Danke für Deine Nachricht!
Meinst Du mit TS (was wohl TypoScript heißen soll?) das Template?
Gruß,
blueberry
Genau, du solltest mal posten, was du in deinem TypoScript stehen hast.
Daniel
Hallo Daniel,
Hier mein Template:
# 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/
}
# 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 = TEXT
subparts.content.value = HELLO WORLD - CONTENT
}
# 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
}
# 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
# 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>
# Second level menu-object, textual
}
Gruß,
blueberry
Du schreibst nirgends hin wo das Menü angezeigt werden soll...
sprich du brauchst noch so was in die Richtung:
page.20 = TEMPLATE
page.20.template =< plugin.tx_automaketemplate_pi1
page.20.workOnSubpart = DOCUMENT_BODY
page.20.subparts {
# dein platz halter bzw. div-element
dein_div_id_element < temp.menu
}
Hi brokemeister,
ich dachte eigentlich das wäre der Teil von Zeile 37 - 53?
# 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
subparts.menu_1 <temp.menu 1
Da ist ein Leerzeichen drin. Das geht nicht. ersetz überall in deinem Script mal temp.menu 1 durch temp.menu_1
Grüße
Christian
Hallo Kitsunet,
danke für den Hinweis, ich habe es ausgebessert, allerdings hat das Menü vorher auch genauso ausgesehen und funktioniert.
Ich versuche mein Problem mal mit Screenshots zu verdeutlichen:.
Das ist die statische html-Seite, die dynamisch werden soll:
Bild: i55.photobucket.com/…/html.jpg
Im Tutorial werden Quellcode und statisches Menü veranschaulicht.
Bild: i55.photobucket.com/…/quellcode.jpg
So sieht meine Seite aus, zu der ich das template gepostet habe.
Bild: i55.photobucket.com/…/meine_seite.jpg
Aber im Tutorial soll die Seite plötzlich so aussehen, d.h. das Menü soll mit der Seitenstruktur der Root page übereinstimmen. Diese Seitenstruktur habe ich angelegt, aber sie wird nicht übernommen.
Bild: i55.photobucket.com/…/ergebnis.jpg
Wie bekomme ich das so hin?
Gruß,
blueberry
Also dein TS sieht ja soweit okay aus, bis auf die Zeile 53.
Die sollte so aussehen:
subparts.menu_1 < temp.menu_1
Ich hab zwar nie mit dem Automaketemplate gearbeitet, abe rwenn ich es richtig im Kopf habe, hast du ja das Menü erstmal händisch erstellt, damit der Automake die entsprechende Subparts generieren kann. Und jetzt ersetzt er einfach die Subparts nicht, so das dein HTML Code aus deinem HTML-Template angezeigt wird.
Vielleicht nochmal prüfen, ob die Subparts richtig im Template drinstehen!
Daniel
Wie sieht das Template denn aus?
Ich bin jetzt mein TS nochmal Schritt für Schritt durchgegangen und habe auch das Tutorial nochmal gelesen.
Dabei ist mir aufgefallen, dass ich einen Satz überlesen hatte. Das folgende Objekt muss VOR der Definition von "temp.mainTemplate" stehen, dann klappt's:
# 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>
}
Danke für die Mithilfe!