We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7155
    • 160 Posts
    Hi, not knowing if this is the right place to ask but how do I conditionally show information depending on which web group a user belongs to.

    P.S. I am aware that there exists a Modx plugin called PHx. Just not sure how I would approach it together with WebloginPE

    An unrelated question:
    Do I have to "disable" or remove weblogin if I make use of WebloginPE? Or I shouldnt even dare thinking about it? smiley
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You could also use the MemberCheck snippet which is installed by default.
        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
        • 7155
        • 160 Posts
        Quote from: sottwell at Jul 02, 2009, 08:04 AM

        You could also use the MemberCheck snippet which is installed by default.
        thank-you,susan. will search for the documentation
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I don’t think there is any, other than what’s in the comments in the snippet itself. You just give it two parameters, one a list of accepted web groups and the other the chunk to show if the user is a member of one of those web groups.
          # Description:
          # Checks to see if users belong to a certain group and
          # displays the specified chunk if they do. Performs several
          # sanity checks and allows to be used multiple times on a page.
          #
          # Params:
          # &groups [array] (REQUIRED)
          # array of webuser group-names to check against
          #
          # &chunk [string] (REQUIRED)
          # name of the chunk to use if passes the check
          #
          # &ph [string] (optional)
          # name of the placeholder to set instead of directly retuning chunk
          #
          # &debug [boolean] (optional | false)
          # turn on debug mode for extra troubleshooting
          #
          # Example Usage:
          #
          # [[MemberCheck? &groups=`siteadmin, registered users` &chunk=`privateSiteNav` &ph=`MemberMenu` &debug=`true`]]
          #
          # This would place the ’members-only’ navigation store in the chunk ’privateSiteNav’
          # into a placeholder (called ’MemberMenu’). It will only do this as long as the user
          # is logged in as a webuser and is a member of the ’siteadmin’ or the ’registered users’
          # groups. The optional debug parameter can be used to display informative error messages
          # when configuring this snippet for your site. For example, if the developer had
          # mistakenly typed ’siteowners’ for the first group, and none existed with debug mode on,
          # it would have returned the error message: The group siteowners could not be found....
          #
            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
            • 7155
            • 160 Posts
            dont know why we sometimes think there’s gotta be "some documentation out there"

            we think too much i guess....(shrug)
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Usually, especially for small snippets like that, the comments at the beginning of the snippet code are the documentation. Some will have documentation included in the zip package (if there is one; very small snippets often are just the one file with the snippet code to paste into a new snippet).

              Most of these snippets were created by a developer on-the-job to fulfill a need for a site they’re working on, and they just don’t have the time to stop and create extra documentation. Anyone who uses a snippet is more than welcome to add documentation to the wiki, or write documentation like the excellent Wayfinder book.
                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
                • 26310
                • 130 Posts
                Can you call a snippet from a chunk using MemberCheck?

                I’m trying to call different menus based on whether or not a user is logged in. However I can’t seem to get WayFinder and Personalize or MemeberCheck to work together.
                  I twitch because I care....and drink too much coffee.
                  • 4172
                  • 5,888 Posts
                  how did you try that?
                  you have to call nested snippet calls reversed unchached/cached

                  if you call [!Personolize............!] uncached, you have to call [[WayFinder............]] cached in personolize-chunk
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!