• I created a menu with three levels.

    Inside this menu I placed some pages more than once in different places. So a page called ‘Estate planning’ appears now as a sub menu item in five places.

    Now I have the problem that when I click on Estate planning under root menu item ‘Private’, the menu in the sidebar changes into the menu for ‘Business’, because that is where this sub page Estate planning appears for the first time in the menu.

    How can I avoid that? I don’t want to make copies of all the pages that appear more than once because because than I wouldn’t be able to make changes to a page from within one page.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Jack, Did anyone step in to help you with this? Or did you figure out how to resolve this? If not, let me know and I’ll be glad to see if I can help you. Gary Gordon

    Thread Starter Jack

    (@moxie)

    Hi Gary. I posted this just one day ago ;), but no, I haven’t got a reply yet, besides from you. I don’t even know if this can be fixed.

    Can I connect with you using Zoom.us? This way you can show me what you’re doing, etc., and I don’t need to log into your site at all. Just contact me back and I’ll provide you my email address so we can connect.

    • This reply was modified 6 years, 7 months ago by Gary Gordon.
    Plugin Author wizzud

    (@wizzud)

    CMW can only work with one Current Item, and it can also only work with what WordPress has determined are the Current Items [in the menu in question].

    For example, let’s say you have a [very simple!] menu of…
    [Page] Alpha
    – [Page] Omega
    [Page] Beta
    – [Page] Omega
    [Page] Gamma
    – [Page] Omega
    …and you use WordPress’s own Navigation Menu widget to show that menu.
    If you show Omega at the front end, then all 3 ‘Omega’ menu items will be marked (by WordPress) as “current”, with each parent item also being marked accordingly.
    If you were to add a CMW instance, looking for Current Item, then CMW would find multiple current items and would elect to use the 1st one (or the last one if you set the Fallback option) as being its Current Item.

    This is because WordPress looks at the here-and-now, as in “Does the page [URL] currently on display match any of the items in this menu?”. It does not reference how you actually got to the page in question, so the fact that you were previously on a “Beta” page when you clicked through to Omega is not relevant (to WordPress, although it obviously is to you!).

    The only way I could achieve what your after is to not use the Page menu items, but to use Custom Links in the menu.
    Eg. the above menu becomes more like…
    [Page] Alpha
    – [Custom Link] ../Omega/?parent=alpha
    [Page] Beta
    – [Custom Link] ../Omega/?parent=beta
    [Page] Gamma
    – [Custom Link] ../Omega/?parent=gamma
    Testing with WordPress’s Navigation Menu widget indicated that clicking on the “?parent=beta” menu item navigated to the Omega page, and the only widget item marked as current was the “?parent=beta” item.
    Then adding a CMW instance that looked for Current Item would correctly show me just the “Beta” part of the menu.

    I’m sure there are other, programmatic, ways to achieve this that don’t result in different URL query strings, but they would involve hooking into a WordPress filter/action somewhere and (hopefully) somehow modifying its determination of Current Item.

    Thread Starter Jack

    (@moxie)

    Thanks Wizzud! Using custom links would be a perfect solution in my case. A little bit of work, but the result would be not three of more items in the menu lighting up a the same time ;). I think the menu should also work with multiple instances of the same item/subpage, but I think that is more for someone at WP to look at.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Pronlem when using the same sub menu item more than once’ is closed to new replies.