We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32982
    • 674 Posts
    Show custom code for manager logged
    $a =$modx->insideManager();
    if ($a=install&&$a=true&&$a=interact&&$a=event&&$_SESSION[’mgrInternalKey’]==1) {
    $html="<table width=’100%’ >
    <tr>
    <td bgcolor=’#D7EBF4’>youarelogged</td>
    </tr>
    </table>";
    return $html;}else{}
    thanks
      Jabiertxof (formerly XYZVISUAL)
      My bussines: http://marker.es
      https://www.youtube.com/user/jabiertxof/videos
    • Oh... i’m definitely not a coder, but does using return instead of echo make a difference?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 18397
        • 3,250 Posts
        Yes and no Ryan. You can use an echo in a snippet (it works) but it doesn’t return the output where the snippet is located. Returns are much better because they do return the output where the snippet is located
          • 32241
          • 1,495 Posts
          xyzvisual,

          did you assign your manager to the right docuement group witht he page that you’re using it? The code will only return true, if the manager is login, manager is under the same document group with the current document group.

          It works in mine, and I did couple mistake, because I forgot to attach the same group on the manager. If you want the super user that has id 1 to be able to see the message as well, without having to be on the same group, you need to modify code to return true, when they have id 1
          if($_SESSION['mgrInternalKey'] == 1) return true;
          


          Sincerely,
            Wendy Novianto
            [font=Verdana]PT DJAMOER Technology Media
            [font=Verdana]Xituz Media
            • 32982
            • 674 Posts
            code changed
            thanks
              Jabiertxof (formerly XYZVISUAL)
              My bussines: http://marker.es
              https://www.youtube.com/user/jabiertxof/videos