We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21054
    • 78 Posts
    Hi,

    I have a website, lets say with the following navigation:

    ==================
    Home

    About Us
    - What We Do
    - Our History

    Our Services
    - Service 1
    - Service 2
    - Service 3

    Testimonials
    - The Industry
    - Previous Clients
    - Current Clients

    Contact Us
    ==================

    All level 2 items in the menu are just headers on its parent page that are anchored. I.e. "The Industry" is just mysite.com/testimonials.html#the-industry

    I’ve set up the Level 2 items as weblinks resources and the friendly URL alias are generated on the fly (i.e. in this case the-industry)

    I filled out the Weblink field like this: [(site_url)][*alias*]#the-industry

    If I’m already on the Testimonials page, it resolves correctly to mysite.com/testimonials.html#the-industry

    However, if I’m in the About Us page, it resolves to mysite.com/about-us.html#the-industry

    I know why this is happening, because [*alias*] relates to the current page you’re at. Is there a solution to refer to the alias of the actual link and its parent?

    Ideally I’d want to do something like this:

    Weblink: [(site_url)][*alias:linkParent*]#[*alias:linkChild*]

    where linkParent would be the alias of the parent of the weblink (testimonials) and linkChild would resolve to the alias of the weblink (the-industry).

    The reason I want to do this is because I’d like to move weblinks around and rename then without having to fiddle with the Weblink every time. All I’d need to change is the parent’s anchor.

    Is this even realistic?

    I’m using MODx Evolution 1.0.3 fresh from an install.

    Thanks guys.


    SIDE NOTE:
    Should I be doing this on WayFinder? Can I tell it to detect second level menu items, or weblinks and insert its #alias ? I’d still need control though, because not all second level menu items will be weblinks. Some will be actual pages.