Hallo und schönen Vormittag zusammen!
Ich habe das Thema schon mehrmals im Forum gefunden, aber leider immer OHNE Lösung.
Vielleicht zeige ich euch zuerst einmal mein Script:
Roottemplate:
# --- configuring the auto-parser plugin
plugin.tx_automaketemplate_pi1 {
# --- read the template file
content = FILE
content.file = uploads/tf/tmp_default.html
# --- select the elements that should be wrapped
elements {
BODY.all = 1
BODY.all.subpartMarker = DOCUMENT_BODY
HEAD.all = 1
HEAD.all.subpartMarker = DOCUMENT_HEADER
HEAD.rmTagSections = title
UL.id.mainnav = 1
UL.id.contact = 1
UL.id.language = 1
DIV.id.content = 1
DIV.id.news = 1
}
}
# --- 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 ###mainnav### subpart with dynamic menu
subparts.mainnav < tmp.MAINNAVIGATION
# --- substitute the ###contact### subpart with dynamic menu
subparts.contact < tmp.EXTRANAVIGATION
# --- substitute the ###language### subpart
subparts.language < tmp.SPRACHE
# --- substitute the ###content### subpart with content
subparts.content < styles.content.get
}
page = PAGE
page.typeNum = 0
page.stylesheet = uploads/tf/styles.css
# --- copying the content from TEMPLATE for <body>-section
page.10 < temp.mainTemplate
page.config {
linkVars = L
sys_language_uid = 0
language = de
locale_all = de_DE
}
[globalVar = GP:L = 1]
page.config {
sys_language_uid = 1
language = eng
locale_all = en_EN
}
[global]
page.config.linkVars := addToList(L)
page.config.uniqueLinkVars = 1
Und hier noch das SPRACHE Template:
tmp.SPRACHE = COA
tmp.SPRACHE {
10 = TEXT
10 {
field = uid
dataWrap = <li><a href="index.php?id= | &L=0">Deutsch</a></li>
}
20 = TEXT
20 {
field = uid
dataWrap = <li><a href="index.php?id= | &L=1">English</a></li>
}
}
Die Home Seite hat ein eigenes Template, das aber lediglich das Template ändert:
plugin.tx_automaketemplate_pi1.content.file = uploads/tf/tmp_start.html
Wenn ich auf einer Folgeseite die Sprache wechsle, funktioniert das perfekt. Im Querystring wird brav
die Variable L gesetzt und die Umschaltung funktioniert einwandfrei.
Nur auf der Startseite kann ich wechseln wie ich will, es wird immer nur die Standardsprache angezeigt!?
Kann es sein, dass ich im 2ten Template (Home) die Einstellungen des Basistemplates verliere?
EDIT: Das Sprachselektor Template ist auch in beiden Templates (Root und Home) als Basis-Template inkludiert - an dem kann's also nicht liegen...
DANKE
montharon