[SOLVED] FEU name display below search box

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
ACDS
Forum Members
Forum Members
Posts: 17
Joined: Tue Jul 12, 2011 12:02 pm

[SOLVED] FEU name display below search box

Post by ACDS »

I've implemented the FEU and SelfRegistration modules.

Is there a way to display the Name (not username) of a logged in user (say for instance below a search box to the top right?).

I would also like to display a link to change user settings, logout etc.

Thanks for the help
Dewald
Last edited by ACDS on Tue Mar 06, 2012 9:09 pm, edited 1 time in total.
maranc
Forum Members
Forum Members
Posts: 249
Joined: Tue May 04, 2010 5:04 pm

Re: FEU name display below search box

Post by maranc »

Use CustomContent module, you will have smarty variable $ccuser:
$ccuser->property('propertyname') - outputs the value of the property for the currently logged in user.

Marek A.
mcDavid
Power Poster
Power Poster
Posts: 377
Joined: Tue Mar 31, 2009 8:45 pm

Re: FEU name display below search box

Post by mcDavid »

That's not even necessary, just {$propertyname} will do.

Use <pre>{get_template_vars}</pre> to display all variables that you can use on your page.
ACDS
Forum Members
Forum Members
Posts: 17
Joined: Tue Jul 12, 2011 12:02 pm

Re: FEU name display below search box

Post by ACDS »

Thanks for the help. Now a follow-up question. How can I get a "Sign out" link just below my username? I tried the FEU sign out form but I do not want the message to display and then the link. I only want a link on the "sign out" text?

Thanks
dewald
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: FEU name display below search box

Post by Dr.CSS »

Customize the sign out template...
ACDS
Forum Members
Forum Members
Posts: 17
Joined: Tue Jul 12, 2011 12:02 pm

Re: FEU name display below search box

Post by ACDS »

Oh my word I'm daft! Thank you!!

So just for the benefit of others as thick as I am. I got everything working and this is what I did:

In my template I used the following code to display a logged in username, the "Change user settings" and a link to the logout template which you can find in FEU.

Code: Select all

<div align=right>
{if $ccuser->loggedin()}
  <b>Logged in as:</b><br/>{$customcontent_loginname}<br/>
{cms_selflink page="change-user-setting" text="Change user settings"}
{FrontEndUsers form="logout"}
{else}
<b>Not logged in</b><br/>
{cms_selflink page="login" text="Login"}
{/if}
</div>
The FEU logout template I edited so that only a link to the default text: "Sign out" is created:

Code: Select all

<!-- Logout form template -->
  <p><a href="{$url_logout}" title="{$mod->Lang('info_logout')}">{$mod->Lang('logout')}</a></p>
<!-- Logout form template -->
From the code above you will see the {cms_selflink page="change-user-setting" text="Change user settings"} is a link to a content page on which I have included the smarty: {FrontEndUsers form="changesettings"}

There might be an easier way of doing this, but I found that I cannot just include the smarty {FrontEndUsers form="changesetting"} in the Template as this throws out the whole formatting of my page (no idea why this is happening but anyway!)

I hope this helps someone...it does the job on my side.

Thanks for the help in the right direction!!

Dewald
Post Reply

Return to “Modules/Add-Ons”