We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46835
    • 11 Posts
    I want to display a DIV where you can register only for people who are logged out. If a person logs in I want that DIV to disappear from the template. Any possibility to do this?

    Thanks. smiley
      • 30912
      • 463 Posts
      You could use personalize for that, or a custom membership snippet.

      http://bobsguides.com/personalize-tutorial.html

      or:

      IsMember
      $output = "";
      
      
      if ($modx ->user ->isMember('Usergroup')){
      $output = $modx->getChunk('Chunk to display');
      }
      else if ($modx ->user ->isMember('anonymous')){
      $output = $modx->getChunk('Display different chunk');
      
      
      return $output;

        • 4172
        • 5,888 Posts
        if you want to test for a specific usergroup, you can also use output-filters:

        [[[[+modx.user.id:ismember=`yourUserGroup`:then=`!$chunkA`:else=`!$chunkB`]]]]
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!