Page 1 of 1
Custom Content and Front end users
Posted: Thu May 03, 2007 10:18 am
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
Re: Custom Content and Front end users
Posted: Thu May 03, 2007 1:39 pm
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
Re: Custom Content and Front end users
Posted: Fri May 04, 2007 10:36 am
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.
Re: Custom Content and Front end users
Posted: Fri May 04, 2007 12:48 pm
by alby
PhilChip wrote:
and the Logged in!! isn't printed anyway.
Debug with {get_template_vars}
Alby
Re: Custom Content and Front end users
Posted: Fri May 04, 2007 1:25 pm
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!
Re: Custom Content and Front end users
Posted: Fri May 04, 2007 1:34 pm
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!!
Re: Custom Content and Front end users
Posted: Fri May 04, 2007 5:12 pm
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
Re: Custom Content and Front end users
Posted: Fri May 04, 2007 5:19 pm
by calguy1000
Set the page as 'non cachable' in the options tab.
Re: Custom Content and Front end users
Posted: Sat May 05, 2007 10:28 am
by PhilChip
That's it! Thank you so much for your help, both of you!
Greetings from Vienna,
Philip