We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7131
    • 83 Posts
    I’m trying to create a TV that returns a chunk only when a web user of group X is connected. What bugs me is to get the web user group(s). Anyone already did this?
      at the edge of dawn,
      you ask yourself if your shadow did follow you down
      all night long
      • 25663 MODX Staff
      • 12,272 Posts
      MemberCheck snippet in the resources.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 7131
        • 83 Posts
        Nice snippet, thanks! However, if the chunk that is called contains a snippet, the snippet is not computed.
          at the edge of dawn,
          you ask yourself if your shadow did follow you down
          all night long
          • 25663 MODX Staff
          • 12,272 Posts
          I think that if you call it uncached ([!MemberCheck!]) and make sure the chunk-contained snippet is cached ([[otherSnippet]]) it should work.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 4195
            • 398 Posts
            The PHx plugin (available from the MODx repository) also handles what you want.
            If you understand the basics of how snippets and/or tv’s work and need a "shorthand" to do this, use:

            [+phx:inrole=`webGroupX`:is=`1`:then=`{{myChunk}}`+]
              Armand Pondman
              MODx Coding Team
              :: Jot :: PHx
              • 7131
              • 83 Posts
              Hello,

              I tried both methods. rthrash’s proposition works, but I can’t figure out for now how PHx works. The wiki docu is not enough extended for me, as a non programmer.

              Thank you both, my community site project is almost done!
                at the edge of dawn,
                you ask yourself if your shadow did follow you down
                all night long