0
votes

Hi I like to add some additional menu items to a defined mainmenu. Here is my attempt:

[PIDinRootline = 18]
lib.mainmenu.1 {
    ACT = 1
    ACT{
            after.cObject = HMENU
            after.cObject < lib.catmenu
    }
}
[END]

well working so far, but the menu items are only showing up when the page 18 is active. I'd like them to be allways visible.

Any Idea?

further information: my menus

lib.catmenu = HMENU
lib.catmenu{
    1 = TMENU
    1 {
            wrap = <div class="megamenu-dropdown"><ul class="level0"> | </ul></div>
            expAll = 1
            noBlur = 1
            NO = 1
            NO.wrapItemAndSub = <li class="level1 nav-1-1 default"> | </li>
            ACT = 1
            ACT.wrapItemAndSub = <li class="level1 nav-1-1 active"> | </li>
    } 
}


lib.mainmenu = HMENU
lib.mainmenu{
entryLevel = 0
1 = TMENU
1{
        expAll = 1
    wrap = <ul id="nav"> | </ul>
    noBlur = 1
    NO = 1
    NO {
        wrapItemAndSub = <li class="level0 nav-1 level-top default"> | </li>
        stdWrap.htmlSpecialChars = 1
        ATagTitle.field = title
    }
    IFSUB = 1
    IFSUB{
            wrapItemAndSub = <li class="level0 nav-1 level-top default parent"> | </li>
                    stdWrap.htmlSpecialChars = 1
                    ATagTitle.field = title
    }
    ACT = 1
    ACT{
                    wrapItemAndSub = <li class="level0 nav-1 level-top default active"> | </li>
            }
}

edit: Thanks for the responses. I try to make my question more understandable.

This is how my menu usually looks like

- home
- shop
- news
  - test
    - subtest

This is how my menu looks like when I open the page with id 18

- home
- shop
  - cat1
  - cat2
- news
  - test
    - subtest

This is how I want my menu allways looks like

 - home
 - shop
   - cat1
   - cat2
 - news
   - test
     - subtest

When I remove the condition [PIDinRoorline = 18] then typo3 has no Idea where to add the additional menu Items. The result is: (I've also changed ACT to NO)

 - home
      - cat1
      - cat2
    - shop
      - cat1
      - cat2
    - news
      - cat1
      - cat2
      - test
        - subtest

So is there any way to say typoscript. "Put my additional menu Items to a specific place"

Thanks for your help! Cheers

1
If you dont want it only to be visible on page with id 18 why dont you remove the condition that checks for id 18? - Daniel
If you want to visible at all pages, then remove the condition so it's works far. Your condition match or configuration worked when 18 page active. and second one also you can add your configuration in mainmenu, why with condition! - Ghanshyam Gohel

1 Answers

0
votes

This is a condition that makes sure that the configuration inside is only taken into account on page 18. Just remove this condition and the configuration will apply.

[PIDinRootline = 18]
...
[END]