Hi All,
I am building a site in Revo, and I have a product page where if the user is logged in I want them to be able to see the spec sheet for the product, else see and message about logging in.
I have followed the ’login’ tut (
http://rtfm.modx.com/display/ADDON/Login) and have managed to create a members only page, but can you have it build into a template?
something like:
[[if logged in `dothis` else `dothis`]]
Any help here welcome...
Linux, PHP 5.2, MySQL 5.0, Revo 2.2.0-pl2
The Personalize snippet will show one chunk to logged-in users and another chunk to the rest.
If you want to redirect users to another page, I think you’d need a custom snippet. Something like this:
<?php
$redirectPage = 12 //ID of the page you want to send not-logged-in users to
if ($modx->user->hasSessionContext('web')) {
return ""; // do nothing if the user is logged in
} else {
$modx->sendRedirect($modx->makeUrl($redirectPage));
}