Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • bobgen Friend
    #159790

    How is possible to put logged user name on screen in line of menu? Example is in attached image.
    Thanks.


    1. UserName1
    Khanh Le Moderator
    #375815

    You can override the block mainnav (templates/ja_purity_ii/layouts/blocks/mainnav.php) to put logged in username. Eg:
    [php]
    <div id=”ja-mainnav” class=”wrap”>
    <div class=”main clearfix”>
    <?php if (($jamenu = $this->loadMenu())) $jamenu->genMenu ($this->getParam(‘startlevel’,0), $this->getParam(‘endlevel’,-1)); ?>
    </div>
    </div>

    <?php if ($this->hasSubmenu() && ($jamenu = $this->loadMenu())) : ?>
    <div id=”ja-subnav” class=”wrap”>
    <div class=”main clearfix”>
    <?php $jamenu->genMenu (1); ?>

    <?php
    //Username if logged in
    $user =& JFactory::getUser();
    if (!$user->get(‘guest’)) : ?>
    <div class=”loggeduser”>Hello <?php echo $user->get(‘username’) ?></div>
    <?php endif;
    //End for add logged user
    ?>
    </div>
    </div>
    <?php endif;?>

    <ul class=”no-display”>
    <li><a href=”<?php echo $this->getCurrentURL();?>#ja-content” title=”<?php echo JText::_(“Skip to content”);?>”><?php echo JText::_(“Skip to content”);?></a></li>
    </ul>

    [/php]

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Khanh Le 13 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum