[FEU] displaying login or guest under the header

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
dvh
Forum Members
Forum Members
Posts: 11
Joined: Fri Sep 26, 2008 3:43 pm

[FEU] displaying login or guest under the header

Post by dvh »

I am trying to get the login used, or if not, guest displayed under the header so the user knows he's logged in or not.
I tried this section in the template:

Code: Select all

   {* Start Breadcrumbs *}
   <div class="breadcrumbs"> 
        {cms_module module=CustomContent} 
        Hi <b>{if $ccuser->loggedin () == false}Guest{else}{"$customcontent_loginname"}{/if}</b>,
        {breadcrumbs starttext='you are here' root='Home' delimiter='»'}
   <hr class="accessibility" />
   </div>
   {* End Breadcrumbs *}
Althought the if condition works always, the loginname is displayed only one time (the next refresh after logon) then I get an empty string on subsequent refreshes.
If I update the template (just clicking apply), on the next navigation click on the site, I get the loginname displayed, until I click on another page, then it's back with an empty string.
What else should I use instead of $customcontent_loginname to achieve this ?
kendo451

Re: [FEU] displaying login or guest under the header

Post by kendo451 »

I see two problems with your syntax:

1.  {if $ccuser->loggedin () == false}

Correct syntax: {if $ccuser->loggedin() == false}

2. When using smarty tags for a variable name, you don't enclose the variable name in quotes so:

{"$customcontent_loginname"} should be ($customcontent_loginname}
Post Reply

Return to “Modules/Add-Ons”