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

    I am new (ish) to Modx in that I had a look at it ages ago and have returned to it again as my own PHP skills are taken AAAGGGGEES to build!

    My question here I’m sure has a very simple answer, but I’m missing something important to get what I want.

    Here’s the set up: I want to use some of the stylized versions of Wayfinder from CSS play, I want the menu to have drop down functionality, so here’s what I did, I created a chunk and put the Wayfinder snippet in, wrapped it in the div class that is relevant to the menu in the CSS file for the menu. I added all the CSS values for the menu to my global CSS file that is in my root.

    When I call the chunk in that I created with the Wayfinder embedded, it all works, apart from one thing, to get the drop down functionality (as I understand it) you create the new page as a resource as a child to a desired parent, so I do this, sure enough the menu works and the drop down part displays on the menu on the site with all the styles I want, however, when you click one of the drop down links (a child of a parent) it calls in a 404 and all the styles are gone. Now I know why this is happening, it’s clearly a path issue, since if I create a parent called ’Services’ then give it children such as ’sites’ ’graphics’ etc, then the link to the page becomes homesite/services/graphics.php and there’s not page there. The styles aren’t available on the 404 page either as it’s clear that the css file is in the root and it’s searching for style.css in homesite/services/... and not finding it.

    I am using friendly URLs, I’m wondering if this is a mod_rewrite issue and I need to specify a Base_url, I have little experience in this and wondered if anyone could give me any pointers. I release that my explanation is a little convoluted, but it’s difficult to explain.

    Any help would be appreciated.

    Thanks
      • 14369
      • 19 Posts
      Let me just update any helpers; it does go to the page, it doesn’t call in a 404 but the page doesn’t reference the style sheet, then if I use the menu to go back to home, then it calls a 404.
        • 14369
        • 19 Posts
        Update:

        I turned off friendly URLs and all was well, so that made me want to sort this out. I don’t know if I am using the PERFECT solution here, but I downloaded a few templates that others had made to see what their code looked like, one guy had added this: <base href="[(site_url)]"></base> and said why he’d done it, it seemed to apply, so I added this to my template and guess what? The style is back in and the sub categories on wayfinder now link to and back to where they’re supposed to.

        If anyone wants to shed some light into the inner workings of this, I’d still appreciate it, I understand what’s happening and why, but could always do with more understanding.

        Thanks