We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15136
    • 34 Posts
    the site I'm building has 2 different types of users. Both are low-level 'member' type users but I'd like each to have their own members only page.

    So, after they login a link would appear that says "Members Only" or something similar and if user 'A' clicks it, it takes them to 1 type of user page and if user 'B' logged in, it would take them to a separate type of user page.

    I was thinking of creating a snippet:

    <?php

    if(user is logged in){

    if(user belongs to resource group 'A'){
    create hyper link to page 1
    }

    if(user belongs to resource group 'B'){
    create hyper link to page 2
    }

    //else do nothing
    }

    //else do nothing

    ?>


    What might be the best way of handling this?
      2.2.4 Revolution
      • 40469
      • 33 Posts
      One solution is to use PHx (not sure it's the best one though)
      http://wiki.modxcms.com/index.php/PHx#mo.3D.60Webgroups.60

      Then you can use different links, depending on the user's webgroup.
      [+phx:mo=`myWebgroup`:then=`I'm a member`:else=`I'm NOT a member`+]

      It might also be possible to use the snippet MemberCheck, but never tried it.