Tim
Tim

Reputation: 6441

Typoscript: HMENU render sub menu in parent element

By default the second level HMENU is rendered after the first element.

 foo = HMENU
 foo {
      1 = TMENU
      1.noBlur = 1
      1.NO = 1
      1.NO.expAll = 1
      1.NO.wrap = <li class="second">|</li>

      2 = TMENU
      2.noBlur = 1
      2.NO = 1
      2.NO.wrap = <li class="second">|</li>
 }

Default HTML :

<li><a href="#">firstlevel 1</a></li>
<li class="second"><a href="#">secondlevel 1</a></li>
<li><a href="#">firstlevel 2</a></li>

But what I want is :

<li>
    <a href="#">firstlevel 1</a>
    <li class="second"><a href="#">secondlevel 1</a></li>
</li>
<li><a href="#">firstlevel 2</a></li>

i.e. The second level is rendered inside the first, not after it. Any ideas appreciated!

Upvotes: 0

Views: 3292

Answers (1)

Krystian Szymukowicz
Krystian Szymukowicz

Reputation: 1488

You need to use:

1.NO.wrapItemAndSub

instead of:

1.NO.wrap

But you lack <ul> in your menu. It will not validate.

The proper menu should look smth like that:

foo = HMENU
foo {
      1 = TMENU
      1.wrap = <ul class="first">|</ul>
      1.noBlur = 1
      1.expAll = 1 
      1.NO.wrapItemAndSub = <li>|</li>

      2 < .1
      2.wrap = <ul class="second">|</ul>

 }

Edit: Moved expAll from "1.NO" to "1"

Upvotes: 6

Related Questions