Hallo!
Die Seite, die ich bauen will hat folgende Struktur:
Sie besteht aus vier Tabellenzellen:
- links oben Logo
- darunter Navigation
- rechts oben irgendwas egal
- rechts unten content
Folgendes einfache Template habe ich hierfür benutzt.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<table width="663" height="328" border="0" cellspacing="4">
<tr>
<td width="92" height="77" bgcolor="#666666"> </td>
<td width="555" bgcolor="#333333"> </td>
</tr>
<tr>
<td height="239" bgcolor="#0066CC" id="menu_1">
</td>
<td id="content"> </td>
</tr>
</table>
</body>
</html>
Um das Dokument anzeigen zu lassen habe ich folgendes in Typo3 unter Template->Setup angegeben:
# Configuring the Auto-Parser for main template:
plugin.tx_automaketemplate_pi1 {
# Read the template file:
content = FILE
content.file = fileadmin/template/main/template_2.htm
# 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/
}
# Menu 1 cObject
hb.menu_1 = HMENU
# Second level menu-object, textual
hb.menu_1.1 = TMENU
hb.menu_1.1 {
# 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>
}
# First level menu-object, textual
hb.menu_1.2 = TMENU
hb.menu_1.2 {
# 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>
}
# Main TEMPLATE cObject for the BODY
hb.mainTemplate = TEMPLATE
hb.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 some example content:
#subparts.menu_1 = TEXT
subparts.menu_1 < temp.menu_1
#subparts.menu_1.value = HELLO WORLD - MENU
# Substitute the ###content### subpart with some example content:
subparts.content = TEXT
subparts.content.value = HELLO WORLD - CONTENT
}
# Main TEMPLATE cObject for the HEAD
hb.headTemplate = TEMPLATE
hb.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 < hb.mainTemplate
# Copying the content from TEMPLATE for <head>-section:
page.headerData.10 < hb.headTemplate
Soweit wird auch alles richtig angezeigt und auch das Menü funktioniert wenn ich Seiten hinzufüge.
Nun will ich jedoch folgendes erreichen. Wenn ich auf Links in der Navigationsleiste (blauer Bereich) drücke, so
soll sich die Hintergrundfarbe der Navigationstabellenzelle ändern.
Muß ich dafür wirklich ein neues Template benutzen oder kann ich auch das jetzige erweitern und dann über das PAGE-Objekt oder ähnlich den Hintergrund ändern?
Bin für Tips jeglicher Art offen.