Andrea_86
Andrea_86

Reputation: 527

Create Menu starting from page uID

I have the necessity to create a HMENU that start from a certain page uid and go recursively along all pages under that one. i tryed to start with a 'special' menu 'list' with that page as the only listed, but dosn't work. Is this possible? any Idea?

Thank in advance for any suggestion

EDIT: That's the solution that work form me

lib.footmenu >
lib.footmenu = HMENU
lib.footmenu.special = directory
lib.footmenu.special.value = 132
lib.footmenu.excludeUidList = 287
lib.footmenu {
    1= TMENU
    1.expAll= 1
    1.wrap = <ul class="menufoot1">|</ul>

    1.NO{
        wrapItemAndSub = <li class="level1">|</li>
        1.ATagTitle.field = title
        1.ATagParams =
    }

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

    3 < .2
    3.wrap = <ul class="menufoot3">|</ul>

    4 < .3
    4.wrap = <ul class="menufoot3">|</ul>

    5 < .4
    5.wrap = <ul class="menufoot3">|</ul>

    6 < .5
    6.wrap = <ul class="menufoot3">|</ul>


}

Now i have one more problem. i want to exclude all page under a certain uid (it's the event page that have too many page inside). I tried with excludeUidList but obviusly it ignore also the page metioned(uid=287), but i want to ignore only its childrens.

Upvotes: 1

Views: 474

Answers (3)

Riccardo De Contardi
Riccardo De Contardi

Reputation: 2148

I think that the problem here, as correctly pointed by @BastianBalthasarBux is the lack of expAll = 1

I think that your TypoScript code could be simplified in this way: (I used this one as example):

lib.footmenu > 
lib.footmenu = HMENU
lib.footmenu.special = list
lib.footmenu.special.value = 132

lib.footmenu {
  1 = TMENU
  1.expAll = 1 
  1.wrap = <ul class="menufoot1">|</ul>
  1.NO {
    wrapItemAndSub = <li>|</li> 
    ATagTitle.field = title
    ATagParams =
  } 
  2 < .1
  2.wrap = <ul class="menufoot2">|</ul>

  3 < .1
  3.wrap = <ul class="menufoot3">|</ul>
}

Upvotes: 0

BastianBalthasarBux
BastianBalthasarBux

Reputation: 446

I would go for

special = directory

and you should add

expAll = 1

to the first level of TMENU (which is then copied over to your sublevels).

Read more about the special keyword in TMENU: https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/ContentObjects/Hmenu/Index.html#the-special-property

Upvotes: 3

Jo Hasenau
Jo Hasenau

Reputation: 2684

You just have to add more levels within your TMENU definition.

See property "1/2/3" in the docs: https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/ContentObjects/Hmenu/Index.html

If you want to see more levels at once you should use the expAll property: https://docs.typo3.org/m/typo3/reference-typoscript/master/en-us/MenuObjects/Tmenu/Index.html

Upvotes: 1

Related Questions