Page 1 of 1

Content Exclude?

Posted: Mon Nov 26, 2007 12:57 am
by sweaverit
I cannot believe I am understanding this, haha.

I've used the FrontEndUser with CustomContent visual tutorial to figure out how to hide the menu (as well as other content throughout the site) from members who are not logged in.  In order to make all the content private, I had to add the following code to my content section of the template:

Code: Select all

{if $ccuser->loggedin()}
  
{content}

{else}

You must be logged in to view this page.

{/if}
However, this hides the login page as well, which needs to be public.

With the menu, all I had to do is add the excludeprefix='private_' to the menu's snippet.  Is there a way to do something like this with the {content} code? 

I tried just adding "excludeprefix='public_'  but that didn't do anything.  I am sure this is because that is to be used on the menu snippet, only.

Thanks a bunch!

Suzanne

Re: Content Exclude?

Posted: Thu Nov 29, 2007 10:26 am
by sweaverit
Anyone?  :-\

Re: Content Exclude?

Posted: Thu Nov 29, 2007 10:41 am
by alby
sweaverit wrote: I've used the FrontEndUser with CustomContent visual tutorial to figure out how to hide the menu (as well as other content throughout the site) from members who are not logged in.  In order to make all the content private, I had to add the following code to my content section of the template:

Code: Select all

{if $ccuser->loggedin()}
  
{content}

{else}

You must be logged in to view this page.

{/if}
However, this hides the login page as well, which needs to be public.
Insert form login where you want but out of {content} and private part:

Code: Select all

{cms_module module="FrontEndUser"}
{if $ccuser->loggedin()}
  
{content}

{else}

You must be logged in to view this page.

{/if}
Alby

Re: Content Exclude?

Posted: Thu Nov 29, 2007 11:30 am
by sweaverit
Okay but the login form has its own page.. How would that work?  ???

Re: Content Exclude?

Posted: Thu Nov 29, 2007 12:15 pm
by alby
sweaverit wrote: Okay but the login form has its own page.. How would that work?  ???
What is alias name of your login page?

Alby

Re: Content Exclude?

Posted: Thu Nov 29, 2007 3:09 pm
by Mantlet
Hey, can't you just show the login form instead of the content? Just put the login form in the if/else statement. That's how I'm testing it and that seems to work. Also, you don't need a seperate loginpage that way...

So, instead of this:

Code: Select all

{cms_module module="FrontEndUser"}
{if $ccuser->loggedin()}
  
{content}

{else}

You must be logged in to view this page.

{/if}
Something like this:

Code: Select all

{cms_module module="FrontEndUser"}
{if $ccuser->loggedin()}
  
{content}

{else}

{cms_module module=FrontEndUsers form='login'}

{/if}

Re: Content Exclude?

Posted: Thu Nov 29, 2007 10:33 pm
by sweaverit
Holy guacamole, why didn't I think of that? That makes so much more sense than what I was trying to do, haha.Thank you!  :D