We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36860
    • 21 Posts
    How do I direct a user to a custom error page when they click on the "members" area link? Right now it is just set to go to standard 404, but I want to use my own that recommends getting membership.

    Thanks
      • 22303 MODX Staff
      • 10,725 Posts
      How is the target Resource of the "members" area link protected? Make sure you provide anonymous users the ability to "load" the Resource (either via Resource Group or Context, depending on how it is protected) but not "view" it. You can see more here.
        • 36860
        • 21 Posts
        It's basically only allowed by the member group in the access permissions tab. I have noticed that when there isn't a user logged in the wayfinder call won't show the resource in the menu so I don't know if I even really need a special error for it. I'd just like to be able to provide an error message just in case.
          • 3749
          • 24,544 Posts
          If the user has no rights to the page (as I think you have it now), it won't show up on any Wayfinder menus or in getResources output. Users who tried to access it directly would be sent to the page specified in the error_page System Setting. If that's what you want, you can leave things alone, although they will go to the same page as anyone who enters a bad URL for the site. It sends them to the home page by default, but you can change the System Setting and send them to any page.

          What opengeek is saying is that if you want to show it in menus or aggregations, but send users to another page when they click on it, you'd have to give them "load" permission but not "view" permission. Without "load" permission, the resource doesn't exist for them and they go to the "page-not-found" page (the error page).
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting