Content Exclude?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
sweaverit
Forum Members
Forum Members
Posts: 36
Joined: Sun Nov 25, 2007 4:03 am

Content Exclude?

Post 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
Last edited by sweaverit on Mon Nov 26, 2007 3:10 pm, edited 1 time in total.
sweaverit
Forum Members
Forum Members
Posts: 36
Joined: Sun Nov 25, 2007 4:03 am

Re: Content Exclude?

Post by sweaverit »

Anyone?  :-\
alby

Re: Content Exclude?

Post 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
sweaverit
Forum Members
Forum Members
Posts: 36
Joined: Sun Nov 25, 2007 4:03 am

Re: Content Exclude?

Post by sweaverit »

Okay but the login form has its own page.. How would that work?  ???
alby

Re: Content Exclude?

Post 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
Mantlet
Forum Members
Forum Members
Posts: 114
Joined: Fri Apr 28, 2006 9:42 am

Re: Content Exclude?

Post 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}
sweaverit
Forum Members
Forum Members
Posts: 36
Joined: Sun Nov 25, 2007 4:03 am

Re: Content Exclude?

Post 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
Last edited by sweaverit on Thu Nov 29, 2007 10:38 pm, edited 1 time in total.
Post Reply

Return to “CMSMS Core”