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

    Is there a way to make Wayfinder list restricted pages even if the user is not logged in or has required permissions?

    This should be such an easy thing to do, but I can’t find the right parameters.
      • 7231
      • 4,205 Posts
      I don’t recall wayfinder having that function and I don’t see it in the docs. However you may be able to hack that in by simply altering the query or the docgroup filtering. This begins on line 347 of wayfinder.inc.php in the assets/snippets/wayfinder directory.

      This section is labeled "// get document groups for current user" but you could also edit the "// build query" section.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 14617
        • 47 Posts
        Ok thanks for the answer. I’ll try and post it here if I make it work smiley
          • 14617
          • 47 Posts
          It worked like a charm. I editet the SQL call to not include {access}. Thank you for your helt
            • 7231
            • 4,205 Posts
            You may want to have two copies of wayfinder (one with a different name and with it’s own set of includes) so that you could use it with the hack or without. Or, maybe even better, help us include this parameter/option to the existing code. I have seen a few requests for this and can see that it would be a nice additional feature, and seems like it would be easy to implement. grin
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              So the purpose of this is to show the protected pages in a menu, then when the user goes there, he gets sent off to a "permissions denied" page that offers them a registration form?
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 7231
                • 4,205 Posts
                I guess that is how it would work. Does weblogin redirect to the requested document after login or will it always go to the assigned login page?

                One way to work around this is to have weblinks to the private documents. This is probably the easiest way to achieve this without modifying the code. This could be useful for site maps or for portal type sites in order to let people know what is inside. Ditto has this parameter as well.
                  [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                  Something is happening here, but you don't know what it is.
                  Do you, Mr. Jones? - [bob dylan]
                  • 14617
                  • 47 Posts
                  On my system I get to the requested (the one in the menu but restricted) after the login form is completed - which is great.

                  The best way would be if there was a parameter &displayRestricted=`TRUE` but I don’t have the skills to make that, yet cool