My client wants users to view the wayfinder links that are currently hidden because they are members only. Non members are directed to the "registration page," while members go to the actual members only page. Can anyone point me in the right direction?
I am using Evolution and Weblogin. Half the links are members only, and they are scattered between three menus.
I'm not sure I understand what you want, but if you add the client to the Members group and the client logs in in the front end, he or she should see the links.
In Revolution, the client could see the links when previewing from the Manager (assuming that the client belongs to the Members user group) without logging in again. There's a way to make that happen in Evolution, but it's somewhat complicated. I think there's a plugin that automatically logs the Manager user into the front end when they log into the Manager. Unfortunately, I can't remember what it's called.
Some additional detail in what I am trying to do. I have a two types of users. Members and Non-Members ( basically the general public ). I want to show ditto'd links to everyone. For non-members if they click a link that is restricted to members only area - they are redirected to a registration page. I am using WebLogin 1.1 with Modx evo 1.0.5.
I was considering using a template variable ( checkLogin with some code like this:
@EVAL if (!$modx->getLoginUserID()) {
$redirectPage = $modx->makeUrl(4); <--redirect to the registration page
$modx->sendRedirect($redirectPage);
}
else {
return "funny!";
}
and then placing it within each page but I'm not certain if this a good practice or NOT being new to MODX.
I also have another slightly nuanced issue with a requirement to show partial content on a page with button like VIEW MORE that would take MEMBERS to the full page BUT redirect NON-Members to a registration page.
Thanks for any insight.
I would probably use a snippet rather than an @EVAL TV and put the content in a chunk, just to keep the content separate from the code. Your code looks reasonable, though.
Another way to go would be to put the content in a chunk and use the ismember output modifier.
Also, if the menu will not be shown on the pages that contain the content, you could just put your redirect code in a snippet and place a tag for that snippet at the top of the pages with the content. That way, everyone would see the links, but when non-members click on them, they get redirected to the registration page.
Bob - thanks for your replies - does the ismember output modifier work for evolution?
Awesome - thanks for the suggestions. I'll give it a try and post back the results.
In Evolution (PHX) it's
mo
* aliases: isinrole, ir, memberof
I don't think Evo has the ismember alias.