[TYPO3] HMENU/TMENU problems (not getting rid of some of the HTML coding on first level/where there are no subpages) SOLVED
Erik Svendsen
erik at linnearad.no
Mon Mar 13 09:13:14 CET 2006
Hello list,
I nights sleep gave me ideas for the solution.
> Hi list
>
> Hope there are some who have a helping hand.
>
> I have a menu who are using following code in TS
>
> <--- snip --->
> lib.subMenu = COA
> lib.subMenu {
> 10 = HMENU
> 10 {
> entryLevel = 1
> stdWrap.dataWrap = <div id="submenu"><div
> id="submenutitle">{leveltitle
> : 1}</div>
> }
> 20 = HMENU
> 20.entryLevel = 1
> 20.wrap = <ul id="level1">|</ul></div>
> 20.1 = TMENU
> 20.1.NO {
> allWrap = <li>|</li>
> ATagParams = style="background:none;"|*|style=""
> }
> 20.1.ACT = 1
> 20.1.ACT {
> allWrap = <li class="act">|</li>
> ATagParams = style="background:none;"|*|style=""
> }
> }
> <--- cut --->
>
> On pages with subpages I get the following HTML, who gives title of
> the current page and the menu of the subpages.
>
> <div id="submenu"><div id="submenutitle">Kunder</div><ul
> id="level1"><li><a href="index.php?id=23" onfocus="blurLink(this);"
> style="background:none;">Internasjonale</a></li><li><a
> href="index.php?id=22" onfocus="blurLink(this);"
> style="">Norske</a></li><li><a href="index.php?id=21"
> onfocus="blurLink(this);" style="">Presseomtale</a></li></ul></div>
>
> On the homepage or pages without subpages I get following output.
>
> <div id="submenu"><div id="submenutitle">TESTside</div><ul
> id="level1"></ul></div>
>
> On the homepage and pages without subpages i want no output at all.
> Because some CSS design are connected to div#submenu and
> div#submenutitle, and don't want this where I don't have a submenu.
>
> I suppose I have to use some if function, maybe isTrue.numRows to
> check for subpage, but I haven't any clue how I should use it to have
> it work on the whole submenu. The home page is more easy, because I
> can use a different template for the root (homepage) without any
> mapping to submenu. But maybe there is another solution.
>
> I have read in the list, searced and read in TSref, but I haven't
> found any solution.
Following TS looks like it works.
<!--- snip --->
[treeLevel = 1,2,3] //Condition who tells that this part only should be used
on treelevel 1, 2, 3, and not 0 (root)
lib.subMenu = COA
lib.subMenu {
10 = HMENU
10.special = directory
10.special.value.field = uid
10.if.isTrue.numRows { //Testing fo subpages - if subpages doesnt exist,
no menu
table = pages
select.pidInList.data = uid
}
10 {
entryLevel = 1
stdWrap.dataWrap = <div id="submenu"><div id="submenutitle">{leveltitle
: 1}</div>
}
20 = HMENU
20.special = directory
20.special.value.field = uid
20.if.isTrue.numRows {
table = pages
select.pidInList.data = uid
}
20.entryLevel = 1
20.wrap = <ul id="level1">|</ul></div>
20.1 = TMENU
20.1.NO {
allWrap = <li>|</li>
ATagParams = style="background:none;"|*|style=""
}
20.1.ACT = 1
20.1.ACT {
allWrap = <li class="act">|</li>
ATagParams = style="background:none;"|*|style=""
}
}
[global]
WBR,
Erik Svendsen
www.linnearad.no
More information about the TYPO3-english
mailing list