We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28033
    • 925 Posts
    I’m changing my successTpl so the Login form "disappears" once it’s filled out (and another chunk shows up in the banner area for the navigation, which will be powered by a special snippet that will show specific links depending on the user’s level).

    Right now, if that template is blank, WLPE returns the name of the template. And if I put in   to get rid of that, it makes a line space, which messes up my layout. I want to have WLPE do nothing in the case that there is no text in the successTpl.
      My Snippets
      -> PopUpChunk v1.0
      • 26435
      • 1,193 Posts
      Open webloginpe.class.php and change the Template() function from:

      <?
      function Template($chunk)
      {
      global $modx;

      $template = ’’;
      if ($modx->getChunk($chunk) != ’’)
      {
      $template = $modx->getChunk($chunk);
      }
      else if (is_file($chunk))
      {
      $template = file_get_contents($chunk);
      }
      else
      {
      $template = $chunk;
      }
      return $template;
      }
      ?>

      to this code:
      <?
      function Template($chunk)
      {
      global $modx;

      $template = ’’;
      if ($modx->getChunk($chunk) != ’’)
      {
      $template = $modx->getChunk($chunk);
      }
      else if (is_file($chunk))
      {
      $template = file_get_contents($chunk);
      }
      else
      {
      $template = ’’;
      }
      return $template;
      }
      ?>

      don’t include the php open and close tags, they are just in the code I posted for syntax highlighting.

      -sD-
      Dr. Scotty Delicious, DFPA.
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 28033
        • 925 Posts
        Alrighty. Thanks for the quick code fix there. laugh
          My Snippets
          -> PopUpChunk v1.0