Page 1 of 1

Add content to Protected page for non-logged in users?

Posted: Thu Jan 30, 2014 4:39 pm
by tophers
I have a site set up that uses FEU to let users pick their location (state). Some content is hidden using the Protected Content page type, based on where you are located. You also have the option to change your state, or even select 'None' if none of the options matches your location.

The issue I'm having is when someone is permitted to view a page, then switches their state to one that ISN'T permitted to see it, the page disappears from the nav (as expected), and the content disappears as well, leaving the user looking at a page devoid of content.

Can I drop some logic on the page to redirect them somewhere if this occurs? Or put some sort of 'default' content up if they get to the page but aren't allowed to see it? The same issue arises if someone links to that page from somewhere and the user isn't logged in to the correct group.


EDIT - we're using FEU without the need to log in as a registered user, so we don't simply want the present the user with a login screen. You can view the site in question at: http://www.superiorplusenergy.com/residential

If you select New York as your state, you can view the Electricity and Natural gas pages, but if you switch to New Jersey (Change State in the grey stripe) they are rendered blank. Thanks in advance for any advice!

Re: Add content to Protected page for non-logged in users?

Posted: Thu Jan 30, 2014 4:54 pm
by calguy1000
The ProtectedContent content type has an optional page to redirect to if login conditions are not met.

Alternatively, you could not use ProtectedContent, but use CustomContent.

Re: Add content to Protected page for non-logged in users?

Posted: Thu Jan 30, 2014 5:06 pm
by tophers
I was looking for something like that - I can redirect all such pages to one spot if needed. Where do I set this? I looked on the individual pages (Options and Permissions), and in Site Admin (Global Settings and Page Defaults), but couldn't find anything. Or is it a Smarty call I need to make in the template?

I'm running CMSMS 1.11.9 and FEU 1.21.18

Re: Add content to Protected page for non-logged in users?

Posted: Thu Jan 30, 2014 5:15 pm
by calguy1000
In the FEU settings.

Re: Add content to Protected page for non-logged in users?

Posted: Thu Jan 30, 2014 6:06 pm
by tophers
Got it. Unfortunately that seems t break the login process for us - as soon as you click on 'Change State' the redirect kicks in and you get punted from the page you are on. This could be a result of how we're using the login procedure, but that's something we can't change at this point.

Any other options available? Out goal was to make these types of pages easy for the client to manage, so I'd prefer not to have to resort to any complicated Custom Content calls if I can help it. Is there something in this post that could potentially help?
http://forum.cmsmadesimple.org/viewtopi ... ntent+type