Custom Content and Front end users

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.
Locked
PhilChip

Custom Content and Front end users

Post by PhilChip »

Hello,

I want to hide a part of my menu for users, that are not logged in. I found the post of calguy1000 (see http://forum.cmsmadesimple.org/index.ph ... 114.0.html ) very useful. But somehow it doesn't seem to work for me.

I named the pages (page alias), that I want to hide with prefix 'priv1_'. In my template I use the following code:

Code: Select all

{cms_module module='CustomContent'} 
{if $customcontent_loggedin > 0}
{menu template='simple_navigation.tpl' start_level='2' collapse='1'}
{else}
{menu excludeprefix='priv1_' template='simple_navigation.tpl' start_level='2' collapse='1'}
{/if}
All private pages ('priv1_') are hided now, perfect!!! - but they stay hided even if I am logged in with my FrontEndUsers account.

I use FrontEndUsers 1.1.2 and MenuManager 1.3 in CMSMS 1.0.5.

Thanks a lot in advance.

Greetings from Vienna,

Philip
alby

Re: Custom Content and Front end users

Post by alby »

PhilChip wrote:
I use FrontEndUsers 1.1.2 and MenuManager 1.3 in CMSMS 1.0.5.
includeprefix or excludeprefix parameter are in MenuManager 1.4.X

Alby
PhilChip

Re: Custom Content and Front end users

Post by PhilChip »

Thanks for your fast reply.

I will update MenuManager and try again, but I'm not sure, that the problem is caused by the MenuManager, because the pages _are_ excluded in menu as they should be when not logged in, but they are not included, when the front end user is logged in. It seems that the $customconent_loggedin variable is never true regardless the login status of the front end user.

I tried the following code:

Code: Select all

{cms_module module='CustomContent'} 
{if $customcontent_loggedin > 0}
<b>Logged in!!!</b>
{menu template='simple_navigation.tpl' start_level='2' collapse='1'}
{else}
{menu excludeprefix='priv1_' template='simple_navigation.tpl' start_level='2' collapse='1'}
{/if}
and the Logged in!! isn't printed anyway.

I'm very thankful for your help.
alby

Re: Custom Content and Front end users

Post by alby »

PhilChip wrote:
and the Logged in!! isn't printed anyway.
Debug with {get_template_vars}

Alby
PhilChip

Re: Custom Content and Front end users

Post by PhilChip »

Thanks again for the fast reply and the good hint.

I updated now Front End Users, Custom Content and MenuManager. Unfortunatly the same problem is still there.

The output of {get_template_vars} is:

Code: Select all

SCRIPT_NAME = /index.php
app_name = CMS
sitename = Leseförderung an Wiener AHS
lang = 
encoding = UTF-8
gCms = Object
ccuser = Object
content_id = 21
page = priv1_arbeitsblatter
page_id = priv1_arbeitsblatter
page_name = priv1_arbeitsblatter
page_alias = priv1_arbeitsblatter
position = 00003.00001.00001
friendly_position = 3.1.1
count = 4
nodelist = Array
node = Object
startform = 
inputbox =
submitbutton =
submittext = Submit
hidden =
endform = 
So there is no $customcontent_loggedin provided to the template variable, am I right? How can I change that?

Thank you very much!
PhilChip

Re: Custom Content and Front end users

Post by PhilChip »

I played arround a while and found out, that the variables $customcontent_loggedin are outputted with {get_template_vars} only once after I delete the cache (CMS) or update the template. But just at the first time I reload the page on the client. After that, the $customcontent_loggedin is null again.

Any ideas?

Thanks a lot!!
alby

Re: Custom Content and Front end users

Post by alby »

PhilChip wrote: I played arround a while and found out, that the variables $customcontent_loggedin are outputted with {get_template_vars} only once after I delete the cache (CMS) or update the template. But just at the first time I reload the page on the client. After that, the $customcontent_loggedin is null again.

Any ideas?
Hum...
Same problem here.
I haven't site with FEU+CC for test. calguy1000  ???

Alby
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Custom Content and Front end users

Post by calguy1000 »

Set the page as 'non cachable' in the options tab.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
PhilChip

Re: Custom Content and Front end users

Post by PhilChip »

That's it! Thank you so much for your help, both of you!

Greetings from Vienna,

Philip
Locked

Return to “CMSMS Core”