use in template file : {assign var='loggedin' value=$ccuser->loggedin()}
use in Content : {if $loggedin}
good luck;
----------------------------------------------------------------------
Goal: to have a custom login area for FEU in a menu template when the user is logged in, one area should show:
Welcome (name) Log out Register
When no user is logged in the same area should show:
You are not logged in Log in Register
The <div> containing the three elements is defined as a menu template (this might have something to do with the unexpected output). Right now it should render as one <li> item.
Code in "login" menu template:
(note: {FrontEndUsers form="logout"} should load the logout page of FEU, which only says "Logout" and when clicked logs out the User from here; but other options are welcome.
(note: for simplicity's sake, the "Register" link is omitted)
Code: Select all
{if $loggedin}<span class="welcome_prompt">Welcome, $username</span>
<span class="logout_button">{FrontEndUsers form="logout"}</span>
{else}<span class="">you are not logged in</span>
<span class="login_button"><a ref="{$url_logout}"
title="{$mod->Lang('info_logout')}">{$mod->Lang('logout')}</span>
{/if}
I also tried <ul>s :
<ul>
{if $loggedin} <li><span class="welcome_prompt">
Welcome, $username</span>
</li>...etc
</ul>
or:
{if $loggedin}<ul> <li><span class="welcome_prompt">
Welcome, $username</span>
</li>...etc
</ul>
;syntax errors, smarty errors, logical errors; I probably have them all
As I was changing the code around, notices are popping up:
Notice: Undefined index: loggedin in C:\xampp\htdocs\mysite\tmp\templates_c\fbf09a8716c53a726a4842338b2fe125^%%80^800^8007C7A5%%module_db_tpl%3AMenuManager%3BNav_login.php on line
Every notice referrs to a /tmp location, such as the one above.
which file is it referring to? where is it located? what's an undefined index? where can I define it, and change it to what?
thanks