Forums / Setup & design / Login box

Login box

Author Message

David Karlsen

Tuesday 02 September 2003 8:17:56 am

Hi,

How can I display a text field like "You are logged inn as <username>" when a user has logged in or "You are not logged in" when the user hasn't??

Also, how could I display a password box that disappears when the user has logged in?

Paul Borgermans

Tuesday 02 September 2003 9:11:54 am

Use something like (from the admin pagelayout):

{section show=eq($current_user.contentobject_id,$anonymous_user_id)}
<a class="menuheadlink" href={"/user/login/"|ezurl}>{'Login'|i18n('design/standard/layout')}</a>
{section-else}
<a class="menuheadlink" href={"/user/logout/"|ezurl}>{'Logout'|i18n('design/standard/layout')}</a> ({$current_user.contentobject.name|wash})
{/section}

Like this, the password box is only displayed once for logging in.

Take a look at the other templates in admin/standard, you can learn/borrow a lot from there

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans