[TYPO3] too much duplicated TS Code
Mario Sargac
marrio at email.si
Mon Jan 16 15:48:48 CET 2006
Dmitry Dulepov wrote:
> TS constants on each page:
> pageDir = xxx
> where X is the directory with image.
>
> Does this work?
>
> Dmitry.
Many thanks Dmitry. This works perfectly!
Here's the code of the complete GMENU in case anyone finds it usefull.
(Now it displays different background image for each page and has a
special menu item colored differently for a special page. It also uses
path to custom font, has one page excluded from the list and shows
rollover title from the subtitle field.)
================= Code - Begin =================
# Menu 1 cObject
lib.menu_1 = HMENU
lib.menu_1.excludeUidList = 10
lib.menu_1.1 = GMENU
lib.menu_1.1 {
applyTotalW = 5
NO.allWrap = |
NO.stdWrap.htmlSpecialChars = 1
ACT = 1
ACT.allWrap = |
ACT.stdWrap.htmlSpecialChars = 1
}
lib.menu_1.1.NO {
ATagTitle.field = subtitle
XY = [10.w]+20,30
backColor = green
5 = IMAGE
5 {
file = fileadmin/templates/res/{$pageDir}/menu_1bg.gif
width = 500
}
10 = TEXT
10 {
text.field = title
text.case = upper
offset = 10,20
align = left
niceText = 0
fontFile = fileadmin/templates/res/myfont.ttf
fontSize = 15
fontColor = white
}
10.if {
value = 2
isInList.field = uid
negate = 1
}
15 = TEXT
15 {
text.field = title
text.case = upper
offset = 10,20
align = left
niceText = 0
fontFile = fileadmin/templates/res/myfont.ttf
fontSize = 15
fontColor = red
}
15.if {
value = 2
isInList.field = uid
}
}
lib.menu_1.1.RO < lib.menu_1.1.NO
lib.menu_1.1.RO = 1
lib.menu_1.1.RO {
7 = IMAGE
7 {
file = fileadmin/templates/res/arrow.gif
align = right
offset = 0,10
}
10.iterations = 2
15.iterations = 2
}
lib.menu_1.1.ACT < lib.menu_1.1.RO
lib.menu_1.1.ACT = 1
lib.menu_1.1.ACT {
10.fontColor = red
10.iterations = 1
15.fontColor = red
15.iterations = 1
}
================= Code - End =================
Greets,
Mario
More information about the TYPO3-english
mailing list