Page 1 of 1

FEU and Custom Content User Question

Posted: Fri Feb 01, 2008 3:22 pm
by Alpdog14
I have been playing around with FEU and CC for a little bit now. I have gotten the groups login working so when someone logins and they are part of a different group they see different content. My Question is: what code do I use if I want different Users to login and they all get unique content for that specific user. I have tried using changing the current group code I have to different variables but nothing seems to be working. Is there a simple solution for this? My current code that works for separate groups login is on a regular content page and its:

{cms_module module=FrontEndUsers} {cms_module module=CustomContent} {if $ccuser->loggedin() && $ccuser->memberof('viewers')} Welcome logged in to Viewing Report {elseif $ccuser->loggedin() && $ccuser->memberof('testing')} Welcome logged in to Testing Center{elseif $ccuser->loggedin()} Welcome user from some other group {else} Anonymous user {/if}

If anyone has any knowledgeable ideas of how or what code to use please reply to this post. Thanks.

Re: FEU and Custom Content User Question

Posted: Fri Feb 01, 2008 3:28 pm
by calguy1000
First of all:

1) You don't need the {cms_module module=CustomContent} call.... CustomContent is always available.

2) you can simplify your code with just {$ccuser->memberof('groupname')} (it checks for logged in too

3) you can use {$customcontent_loginname} to check for particular users

put {get_template_vars} into your page template and see what variables are available when you're logged in.

Re: FEU and Custom Content User Question

Posted: Fri Feb 01, 2008 3:45 pm
by Alpdog14
Hi calguy, thanks for your quick reply. I tried changing my code in my page to your suggestions and this is what I came up with:

{cms_module module=FrontEndUsers} {if $customcontent_loginname('cabplan')} Welcome Chris {if $customcontent_loginname('tonyvalle')} Welcome Tony {if $customcontent_loginname('Sharon')} Welcome Sharon {if $customcontent_loginname('Alpdog14')} {else if}Welcome Alpdog14 {loggedin()} Welcome Guest {else} Anonymous user {/if}

I do not think its right because I got a huge smarty error message. i think i am using the $customcontent_loginname wrong but not sure what to fix.

also where in my template do i place {get_template_vars}, should i place this first in my template then try using the code? what does {get_template_vars} actually do? does is recognize the variables?

Re: FEU and Custom Content User Question

Posted: Fri Feb 01, 2008 4:16 pm
by alby
Alpdog14 wrote: {cms_module module=FrontEndUsers} {if $customcontent_loginname('cabplan')} Welcome Chris {if $customcontent_loginname('tonyvalle')} Welcome Tony {if $customcontent_loginname('Sharon')} Welcome Sharon {if $customcontent_loginname('Alpdog14')} {else if}Welcome Alpdog14 {loggedin()} Welcome Guest {else} Anonymous user {/if}
After login, FrontEndUsers change the display from login form to Welcome loginname

For your code use:
{if $customcontent_loginname == 'cabplan'}Welcome Chris
{elseif $customcontent_loginname == 'tonyvalle'}Welcome Tony
{elseif $customcontent_loginname == 'Sharon'}Welcome Sharon
.....
{else}Anonymous user
{/if}

Alpdog14 wrote: also where in my template do i place {get_template_vars}, should i place this first in my template then try using the code? what does {get_template_vars} actually do? does is recognize the variables?
Put the code at the end of the template (or after calling module).
That code display all variables that you can use. If you see an Array/Object variable, you can look in this with:
{$name_of_variable|print_r}

Alby

Re: FEU and Custom Content User Question

Posted: Fri Feb 01, 2008 5:16 pm
by Pierre M.

Re: FEU and Custom Content User Question

Posted: Fri Feb 01, 2008 5:48 pm
by Alpdog14
Thanks Pierre M. this link was very helpful. it did have all the things i am actually trying to do. I want new pages for new users. one thing i have a question about is if my client creates new users in FEU and if he has no idea about coding. how can i make it so CMSMS creates a new page specifically for that created user and somehow apply a link to a upload document on that new user page. To give you an idea of what i want CMSMS to do I found this other CMS: http://www.homeinspectionwebsites.com/admin/
in this tool you can click on Report Upload which there you can create a username, password and upload a document which then creates a whole new page behind the scenes for that specific user when that user is ready to login and view their uploaded document. Please let me know if anyone has any advice on how to accomplish this.