We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21560
    • 145 Posts
    I got a very simple problem:

    I have page which is visible to the public (login page) but I want it hidden when a user is logged in.

    More details:
    I use a normal auto-generated menu and the ’login’ entry is visible to the public and the menu. But when people are logged in I don’t want to change the name (I know how that works) but want the entry to be removed entirally.

    So a logged in user NOT seeing a page that a public user (not logged in) CAN see.

    Alternately, I’m looking for this because on my ISS server it seems that protected pages aren’t redirected but just pop up a .htaccess like "username/password" box. So I’m cheating by renaming the login page to be the same as the normal one (resources) and having the normal one visible only to logged in users. The plan was that the normal Resources page isn’t in the menu but the login page (named Resources) in it’s place. So people click on it, log in and hey presto! The resources page appears in it’s stead.
      [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
      • 25663 MODX Staff
      • 12,272 Posts
      Two options: use MemberCheck or PHx
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 21560
        • 145 Posts
        MemberCheck, how do you mean?
        PHX? What is it?
          [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
          • 29181
          • 480 Posts
          MemberCheck and PhX are two snippets available in the "Resources".

          Cheers,
          Taff
            Adrian Lawley: www.adrianlawley.com
            • 21560
            • 145 Posts
            Right, that solves one problem but gives me the next. The new and improved membercheck (v1.1 with Defautl Function) loads the chunk nicely but doesn’t parse it.

            Please login to access our resources. [!WebLogin? &tpl=`FormLogin` &loginhomeid=`7`!]



            The idea is simply that I wish to have a login / register where otherwise contents would be found, obviously.

            I’ve tried both methods of calling the MemberCheck snippet

            [!MemberCheck? &groups=`WebUsers` &chunk=`Site_Resources` &default=`Site_Login` &ph=`Page_Contents` &debug=`true`!]
            [+Page_Contents+]

            And
            [!MemberCheck? &groups=`WebUsers` &chunk=`Site_Resources` &default=`Site_Login' &debug=`true`!]
              [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
              • 21560
              • 145 Posts
              Just to add, I’ve also looked into the snippet code itself. It does a ’modx->getChunk($name)’ but no parsing. I’ve looked into the MODx documentation but failed to find a ’parse’ function.
                [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
                • 21560
                • 145 Posts
                Anyone got a hint?
                  [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com
                  • 22303 MODX Staff
                  • 10,725 Posts
                  Parsing of tags in the content processed by MODx is done automatically. If it’s not being processed, something is interfering with the parsing on that page. Could be any number of things, but PHx could be a possible source of the issue, as could nesting the tags too deep (you can adjust the max parser passes in your index.php) or within cacheable tags on a cacheable page.
                    • 21560
                    • 145 Posts
                    In this case it shouldn’t be a case as such. It’s only 2 levels deep.

                    Page -> MemberCheck -> Weblogin

                    Just to note, if I place the code directly on the page it works perfectly fine (of course)

                    I’ve also set values in index.php
                    $modx->minParserPasses = 1; // min number of parser recursive loops or passes
                    $modx->maxParserPasses = 20; // max number of parser recursive loops or passes
                    To min 50 and max 50. With no effect.

                    Fortunatly I’ve thought of a temporary solution, but I would like to know why this is happening.
                      [font=Times]Comics, stories, music, graphics, games and more! http://Nimja.com