Einzelnen Beitrag anzeigen
  #1  
Alt 06.04.06, 03:10
hans-martin hans-martin ist offline
Forum Newbie
 
Registriert seit: 06.04.06
Alter: 27
Beiträge: 26
Ausrufezeichen

Hilfe! - wie binde ich die Klassen ein ohne die Struktur zu ändern


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:
# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
# Read the template file:
content = FILE
content.file = fileadmin/template_th/index.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_th/
}

#Navi
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}">
   #before.cObject.dataWrap = <a href="|.html" 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=|">
   #before.cObject.dataWrap = <a href="|.html">
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> ||
}

}



# 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 ###nav### subpart with dynamic menu:
subparts.nav< subparts.nav

# Substitute the ###content### subpart with some example content:
subparts.content < 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
}
# 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

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.
Mit Zitat antworten
TYPO3forum.net empfiehlt den T3N Testsieger: Bestes Preis-Leistungs-Verhältnis (Ausgabe 12/2008)