We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    Ok it's solved! Thanks for the help, I used Personalize snippet.

    Snippet called LoggedOrNot:
    $o = '';
    $yesChunk = (isset($yesChunk))? $yesChunk : '';
    $noChunk = (isset($noChunk))? $noChunk : '';
    
    if(isset($_SESSION['webShortname'])){
        $test = $_SESSION['webShortname'];
        $o = $modx->getChunk($yesChunk);
      } else {
        $o = $modx->getChunk($noChunk);
    }
    
    if (isset($ph)) {
    	$modx->setPlaceholder($ph,$test);
    	return $o;
    } else {
    	return $o;
    }
    


    My call:
    [!LoggedOrNot? &yesChunk=`yes` &noChunk=`no`!]


    Chunk yes:
    <a href="[~40~]">login</a>


    Chunk no:
    <a href="[~40~]">logout</a>


    Or you can do <a href="[~loggedoutpage~]?webloginmode=lo">logout</a> [ed. note: fourroses666 last edited this post 13 years, 5 months ago.]
      Evolution user, I like the back-end speed and simplicity smiley
      • 42838
      • 28 Posts
      I don't have instled version Evo. You can try it in your snipped:
      if (isset($_SESSION['webValidated']))
      {
      return '<a href="[~10~]">Logout</a>';
      }
      else
      {
      return '<a href="[~10~]">Login</a>';
      }
      
        • 37105
        • 194 Posts
        Just use the extra Personalize as Paul advised.
        [[!Personalize?
            &yesChunk=`@CODE:<a href="[~10~]">Logout</a>`
            &noChunk=`@CODE:<a href="[~10~]">Login</a>`
        ]]
          Codeplaza Webdesign: for professional websites at low cost
          • 42838
          • 28 Posts
          Quote from: donquicky at Apr 05, 2013, 04:35 AM
          Just use the extra Personalize as Paul advised.
          [[!Personalize?
              &yesChunk=`@CODE:<a href="[~10~]">Logout</a>`
              &noChunk=`@CODE:<a href="[~10~]">Login</a>`
          ]]

          it is realy beauty solution.
            • 9995
            • 1,613 Posts
            Didn't know Personalize comes with the install (evo 1.0.9).

            Thanks again all.



            [ed. note: fourroses666 last edited this post 13 years ago.]
              Evolution user, I like the back-end speed and simplicity smiley