We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31912 MODX Staff
    • 95 Posts
    Is it possible to use PHx to display a chunk/text if the user is logged in as a manager? similar to this: [+phx:mo=`myWebgroup`:then=`I’m a member`:else=`I’m NOT a member`+] but using manager groups.

    Essentially I want to be able to include links for manager users for help pertaining to particular pages, or possibly include a link to a Ditto listing for the manager to jump to & edit that page using QM+ (otherwise the listing would just be text and not a public accessible link.)

    I have found a few similar questions in the forum but did not see a solution–I apologize if I just missed it.

    Thanks!
      • 33337
      • 3,975 Posts
      I think PHx isnt capable of that, but you can see if it helps: http://modxcms.com/extras.html?view=package/view&package=270

      Regards.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 31912 MODX Staff
        • 95 Posts
        Thanks, I will play around with that (managercheck) a bit more. I gave it a quick shot earlier and it didn’t seem to work.
          • 10313
          • 375 Posts
          I did it with a little custom modifier:

          snippet phx:loggedIn
          <?php
          global $modx;
          if(isset ($_SESSION['mgrValidated'])){
              return true;
          }
          else{
              return false;
          }
          ?>


          Thus I can use PHx this way:
          [+phx:loggedIn:is=`1`:then=`{{loggedInChunk}}`:else=`{{notLoggedInChunk}}`+]


          Works quite fine for me.
            • 31912 MODX Staff
            • 95 Posts
            Thank you, that is exactly what I was looking for and will keep note of it for future projects.
              • 33337
              • 3,975 Posts
              Zaigham (aka zi) Reply #6, 17 years ago
              Quote from: FuryDE at Oct 01, 2009, 08:30 AM

              I did it with a little custom modifier:

              snippet phx:loggedIn
              <?php
              global $modx;
              if(isset ($_SESSION['mgrValidated'])){
                  return true;
              }
              else{
                  return false;
              }
              ?>


              Thus I can use PHx this way:
              [+phx:loggedIn:is=`1`:then=`{{loggedInChunk}}`:else=`{{notLoggedInChunk}}`+]


              Works quite fine for me.
              Thanks for the contribution! Please don’t forget to add it to this page: http://wiki.modxcms.com/index.php/PHx/CustomModifiers

                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 3749
                • 24,544 Posts
                Quote from: zi at Oct 06, 2009, 01:13 PM


                Thanks for the contribution! Please don’t forget to add it to this page: http://wiki.modxcms.com/index.php/PHx/CustomModifiers

                I went ahead and added it. smiley
                  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
                  • 10313
                  • 375 Posts
                  Quote from: BobRay at Oct 06, 2009, 03:32 PM

                  Quote from: zi at Oct 06, 2009, 01:13 PM


                  Thanks for the contribution! Please don’t forget to add it to this page: http://wiki.modxcms.com/index.php/PHx/CustomModifiers

                  I went ahead and added it. smiley
                  Thanks, I just corrected the usage part.

                  Martin
                    • 33337
                    • 3,975 Posts
                    Zaigham (aka zi) Reply #9, 17 years ago
                    Thank you Bob and Martin.! smiley
                      Zaigham R - MODX Professional | Skype | Email | Twitter

                      Digging the interwebs for #MODX gems and bringing it to you. modx.link
                      • 5675
                      • 120 Posts
                      This modifier always shows YES on 1.10 & 1.12. Any alternative?
                        Автор благодарит алфавит за любезно предоставленные буквы