[TYPO3] problem with insertdata and wrap
lee perry
leeperry at slack.de
Thu Jun 19 19:36:30 CEST 2008
> Hi Lee
> I totally understand your concerning...the choose to change the class of
> the menubox is to meet the designer requirement to change background and
> colors for any mainmenu item and display a submenu on different
> background (not easy as kickstart!!!)
> Anyhow your suggestion worked right but the problem seems that with
> {page:uid} i get an id which is not corrisponding to the main menu uid.
> if I use {page:pid} I got the right pid but only in subpages and not at
> the main level (if I click the main menu item, e.g.).
> About the div used as spacer, that seems coreect the behaviour in ff and
> ie.
>
> I was wondering if I can use the PIDinRootline function to check if the
> main menu id is in the rootline of the selected submenu and wrap
> subsequently...but still not clear how to use if/switch conditions.
>
> ## subMenu [Begin]
> lib.subMenu= HMENU
> lib.subMenu.entryLevel = 1
> lib.subMenu{
> stdWrap.dataWrap = <div class="LeftMenuBox-id{page: pid}"><div
> style="height:70px;"></div>|</div>
> }
> lib.subMenu.1 = TMENU
> lib.subMenu.1 {
> stdWrap.wrap = <ul id="LeftMenuList">|</ul></div>
> }
> lib.subMenu.1.NO {
> allWrap = <li>|</li>
> }
> lib.subMenu.1.ACT = 1
> lib.subMenu.1.ACT.allWrap = <li class="LeftMenu-ACT">|</li>
> ## subMenu [End]
>
> Thanks again for your help and to take time to review this.
>
> Regards
>
> Luca
okay, do you need a navigation like this navigation on the following
website:
http://www.bildungsberatung-berlin.de ?
every navigation item has it's own class and so every main navigation
link is different (different background colors) and the sub navigation
links have the same color of their parent link.
it works with an incremental number on each class (nav1, nav2, nav3, ...
and subnav1, subnav2, subnav3 ...).
you can see the typoscript of this menu here:
lib.mainNav = HMENU
lib.mainNav {
entryLevel = 1
1 = TMENU
1 {
wrap = <ul id="mainNav">|</ul>
NO = 1
NO {
before.cObject=LOAD_REGISTER
before.cObject{
menuNumber.cObject=TEXT
menuNumber.cObject{
value={register:menuNumber}+1
insertData=1
}
menuNumber.prioriCalc=intval
}
stdWrap.wrap = <span class="bar"> </span><span class="text">|</span>
ATagParams = class="nav{register:menuNumber}"
linkWrap = <li>|</li>
allStdWrap.insertData=1
}
ACT < .NO
ACT = 1
ACT {
linkWrap = <li class="active">|</li>
}
CUR < .ACT
ACTIFSUB < .ACT
ACTIFSUB.linkWrap = <li class="active sub">|
CURIFSUB < .ACTIFSUB
CURIFSUB.linkWrap = <li class="active sub">|
}
2 < .1
2{
wrap = <ul class="subNav">|</ul></li>
NO {
before.cObject.menuNumber.cObject.value={register:menuNumber}
stdWrap.wrap = <span class="text">|<img
src="fileadmin/templates/images/nav_blank.gif" width="17" height="17"
class="nav_blank" /></span>
ATagParams = class="subnav{register:menuNumber}"
}
ACT < .NO
ACT = 1
ACT {
linkWrap = <li class="active">|</li>
}
CUR < .ACT
ACTIFSUB < .ACT
CURIFSUB < .ACTIFSUB
}
}
maybe it's not optimized, but maybe it will help you anyway.
greetings
lee
ps.: that's it for today - time to finish my work and to see the first
game of the quarter-final: Portugal - Germany (I have to get a good
place to see)
More information about the TYPO3-english
mailing list