Ich realisiere gerade ein etwas komplexeres Typo3 Projekt, jetzt stellen sich mir einige Fragen:
- Ich möchte verschiedene CSS Klassen in den Head einbinden, bzw. die Werte der Klassen Templatespezifisch anpassen.
Ansich ja dank Autoparser etc. kein Problem. Ich habe mein Template aber wg. der Navi zentral eingebunden also für alle in der Hierachie unterliegenden Seiten gibt es momentan nur ein template.
Hier der Aufbau
Typoscript-Code:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114:
| plugin.tx_automaketemplate_pi1 { content = FILE content.file = fileadmin/template_th/index.html elements { BODY.all = 1 BODY.all.subpartMarker = DOCUMENT_BODY HEAD.all = 1 HEAD.all.subpartMarker = DOCUMENT_HEADER HEAD.rmTagSections = title TD.all = 1 } relPathPrefix = fileadmin/template_th/ } subparts.nav = HMENU subparts.nav.1= TMENU subparts.nav.1{ expAll = 0 wrap = <ul>|</ul> NO { beforeWrap = <li id="first">| || <li id="second">| || <li id="third">| ||<li id="fourth">| || <li id="fifth">| || <li id="sixth">| || <li id="seven">| || <li id="eight">| || <li id="nine">| || <li id="ten">| linkWrap = | doNotShowLink = 1 before.cObject = TEXT before.cObject.field = uid before.cObject.dataWrap = <a href="index.php?id=|" accesskey="{field:tx_govaccessibility_accesskey}" title="{field:title}:{field:subtitle} ACCESSKEY: {field:tx_govaccessibility_accesskey}"> after.cObject = TEXT after.cObject.field = title//nav_title after.cObject.htmlSpecialChars = 1 after.cObject.wrap = |</a> wrapItemAndSub = |</li> || |</li> || |</li> || |</li> || |</li> || |</li> || |</li> || |</li> || |</li> || |</li> || } ACT > .NO ACT = 1 ACT { beforeWrap = <li id="first_act">| || <li id="second_act">| || <li id="third_act">| ||<li id="fourth_act">| || <li id="fifth_act">| || <li id="sixth_act">| || <li id="seven_act">| || <li id="eight_act">| || <li id="nine_act">| || <li id="ten_act">| || wrapItemAndSub = |</li> || |</li> || |</li>|| |</li> || |</li> || |</li> || |</li> || |</li> || |</li> || |</li> || } } subparts.nav.2= TMENU subparts.nav.2{ expAll = 0 wrap = <ul id="liste" style="margin:0px 0px 0px 0px;padding-top:0px;">|</ul> NO { beforeWrap = <li id="first_act_sub">| linkWrap = | doNotShowLink = 1 before.cObject = TEXT before.cObject.field = uid before.cObject.dataWrap = <a href="index.php?id=|"> after.cObject = TEXT after.cObject.field = title//nav_title after.cObject.htmlSpecialChars = 1 after.cObject.wrap = |</a> wrapItemAndSub = |</li>|| } ACT > .NO ACT = 1 ACT { beforeWrap = <li id="first_act_sub">| wrapItemAndSub = |</li> || } } temp.mainTemplate = TEMPLATE temp.mainTemplate { template =< plugin.tx_automaketemplate_pi1 workOnSubpart = DOCUMENT_BODY subparts.nav< subparts.nav subparts.content < styles.content.get } temp.headTemplate = TEMPLATE temp.headTemplate { template =< plugin.tx_automaketemplate_pi1 workOnSubpart = DOCUMENT_HEADER } page = PAGE page.typeNum = 0 page.10 < temp.mainTemplate page.headerData.10 < temp.headTemplate |
Da die Sublevels der Navi Kategorieabhängig verschiedene Farben haben, dachte ich am besten die Klassenbenennung gleich lassen und die damit verknüpften Styles im Dokumenthead[statt verschiedene css ist flexibler bei einer klasse denke ich] wechseln. Würdet ihr das auhc so lösen oder einen generellen Strukturumbau vorschlagen? Wenn ja, wie binde ich die Klassen ein ohne die Struktur zu ändern?
Danke für eure Hilfe.