[TYPO3-english] How to integrate a loop when building HMENU?

Benoit Montereau bmontereau at gmail.com
Tue Oct 26 12:10:46 CEST 2010


Dear Joey,
As mentionned in my previous email, I prepared an picture and a part of html
code to explain what I need to create for my website.

On the attached picture, you can see my menus in different situation. When
the first page is displayed only the css layer menu are available/visible.

As soon as you go in the subpages (having themselves subpages), the css
layer menu should still be available (triggered by mouse over the first
level menu) AND the structure of the current page (+ subpages) should be
displayed below (of course depending on the current subpage).

At the html/css level, the example of my picture looks like (final
presentation will be improved in the end):

<div id="dynmenu" style="display:block;border:1px solid
#000;margin-left:300px;margin-top:15px;position:absolute;">
<div class="cssmenuWrap"><ul id="nav2">
<li class="menuparent"><a href="fr/welcome.html">Welcome</a></li><li
class="li_act menuparent"><a href="#" class="ifsubarrow">Page 1</a><ul><li
class="menuparent"><a href="#" class="ifsubarrow">Page 1.1</a><ul><li
class="menuparent"><a href="#">Page 1.1.1</a></li><li class="menuparent"><a
href="#">Page 1.1.2</a></li></ul></li><li class="li_act"><a href="#">Page
1.2</a></li></ul></li>*<table border="0"><tr><td><b><a href="#">page
1.1</a></b><br />&nbsp;&nbsp;<a href="#">page 1.1.1</a><br
/><b>&nbsp;&nbsp;<a href="#">page 1.1.2</a></b><br />&nbsp;<a href="#">page
1.2</a></td></tr></table>*
<li class="menuparent">...</ul></div></div>

To generate my css menus, here is the TS I'm using:

### Typoscript Code ##########
temp.layermenu2 = HMENU
temp.layermenu2 {
   entryLevel = 0
1 = TMENU
1 {
expAll = 1
wrap = <div class="cssmenuWrap"><ul id="nav2">|</ul></div>
noBlur = 1
NO = 1
NO.wrapItemAndSub = <li class="menuparent level1">|</li>

ACT = 1
ACT.wrapItemAndSub = <li class="li_act">|</li>
IFSUB = 1
IFSUB.wrapItemAndSub = <li class="menuparent">|</li>
IFSUB.ATagParams = class="ifsubarrow"

ACTIFSUB = 1
ACTIFSUB.wrapItemAndSub = <li class="li_act menuparent">|</li> *[additional
submenu code should be added here: <table>... </table>]*
ACTIFSUB.ATagParams = class="ifsubarrow"

}
2 < .1
        2 {
#no 'static' submenu on levels 2 and 3 wrap = <ul>|</ul> ACT = 1
ACT.wrapItemAndSub = <li class="li_act">|</li> ACTIFSUB = 1
ACTIFSUB.wrapItemAndSub = <li class="li_act menuparent">|</li>
ACTIFSUB.ATagParams = class="ifsubarrow" }

3 < .2
}



My problem is to integrate the non css layer part (<table>...</table>) into
the css layer definition. By the way I first try to use <ul><li>... instead
of <table> but in this case nothing appears!

A excellent similar menu behaviour can be see on this website:
http://www.grolley.ch/fr/admin/dechets/collecte/ (menu displaying is
sometimes slow).

Maybe I'm doing something totally wrong with my menu, but I realy don't know
how to get the expected result and especially to get dynamically the
additionnal part (between []). I was hoping to generate this part in another
script (ie temp.htmlmenu) store the result into a variable and integrate
this variable in temp.layermenu2, but it does not seem to be possible as
well.

I hope my explanation put some light on my problem and hope you can help me.

Thank you in advance for your help.
Regards,
BM





On Fri, Oct 22, 2010 at 2:19 PM, JoH asenau <info at cybercraft.de> wrote:

> > In fact going further in my reflexion, I would get the expected
> > result if I can embed into a HMENU output the output of another HMENU
> > (smaller) output.
>
> Isn't this the default behaviour of an HMENU?
>
> 10 = HMENU
> 10 {
>    1 = TMENU
>    1 {
>        wrap = <ul class="level1">|</ul>
>        NO {
>            wrapItemAndSub = <li>|</li>
>        }
>    }
>    2 < .1
>    2.wrap = <ul class="level2">|</ul>
> }
>
> This will put the level2 menu block before the closing li-tag of a level1
> item.
>
> HTH
>
> Joey
>
> --
> Wenn man keine Ahnung hat: Einfach mal Fresse halten!
> (If you have no clues: simply shut your gob sometimes!)
> Dieter Nuhr, German comedian
> Xing: http://contact.cybercraft.de
> Twitter: http://twitter.com/bunnyfield
> TYPO3 cookbook (2nd edition): http://www.typo3experts.com
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
>


More information about the TYPO3-english mailing list