[CUSTOM] Move Register, Login and Tools Button

GK User
Thu Feb 03, 2011 7:42 pm
Is it possible to move Register and Login button to another place?
User avatar
Fresh Boarder

GK User
Thu Feb 03, 2011 8:23 pm
sure is...

where you want it ?!
User avatar
Platinum Boarder

GK User
Fri Feb 04, 2011 7:21 am
I want to move it on another module position (like top_nav), but when I do that it shows full registration form or login form...
User avatar
Fresh Boarder

GK User
Fri Feb 04, 2011 7:51 pm
the module positions are made for the dropdown. if you enable it anywhere it will show it normal. you will have to move the positions not the module...
User avatar
Platinum Boarder

GK User
Sat Feb 05, 2011 8:15 pm
I don't really understand what I have to do... :sick:
User avatar
Fresh Boarder

GK User
Sun Feb 06, 2011 1:43 am
Follow this instructions:

Open ../layouts/blocks/nav.php and after this lines:

Code: Select all
<jdoc:include type="modules" name="breadcrumb" style="none" />
      <?php endif; ?>
   </div>
   <?php endif; ?>

add this code
Code: Select all
<div id="tool-top-nav">
   <?php if($this->getTools() || GK_REGISTER || GK_LOGIN) : ?>
   <?php if($this->getTools()) : ?>
        <a href="#" id="btn-tools"><span><?php echo JText::_('GK_TOOLS'); ?></span></a>
           
        <div class="gk_hide">
           <div class="gk_popup-hide" id="popup_tools">
              <?php $this->loadBlock('usertools/tools') ?>
           </div>
        </div>
        <?php endif; ?>
       
        <?php if(GK_REGISTER) : ?>
      <a href="<?php echo $this->baseurl(); ?>index.php?option=com_user&view=register" id="btn_register"><span><?php echo JText::_('GK_REGISTER'); ?></span></a>
      <?php endif; ?>

      <?php if(GK_LOGIN) : ?>
      <a href="<?php echo $this->baseurl(); ?>index.php?option=com_user&view=login" id="btn_login"><span><?php echo ($userID > 0) ? JText::_('GK_LOGOUT') : JText::_('GK_LOGIN'); ?></span></a>
      <?php endif; ?>
      
    <?php endif; ?>
   </div>


Next open ../layouts/blocks/nav.php/top.php and replace this code:

Code: Select all
    <?php if($this->countModules('search') || $this->getTools() || GK_REGISTER || GK_LOGIN) : ?>
       <?php if( $this->countModules('search') ): ?>
        <div class="gk-search">
           <jdoc:include type="modules" name="search" style="none" />
        </div>
        <?php endif; ?>
           
        <?php if($this->getTools()) : ?>
        <a href="#" id="btn-tools"><span><?php echo JText::_('GK_TOOLS'); ?></span></a>
           
        <div class="gk_hide">
           <div class="gk_popup-hide" id="popup_tools">
              <?php $this->loadBlock('usertools/tools') ?>
           </div>
        </div>
        <?php endif; ?>
       
        <?php if(GK_REGISTER) : ?>
      <a href="<?php echo $this->baseurl(); ?>index.php?option=com_user&view=register" id="btn_register"><span><?php echo JText::_('GK_REGISTER'); ?></span></a>
      <?php endif; ?>

      <?php if(GK_LOGIN) : ?>
      <a href="<?php echo $this->baseurl(); ?>index.php?option=com_user&view=login" id="btn_login"><span><?php echo ($userID > 0) ? JText::_('GK_LOGOUT') : JText::_('GK_LOGIN'); ?></span></a>
      <?php endif; ?>

    <?php endif; ?>


with
Code: Select all
<?php if( $this->countModules('search') ): ?>
        <div class="gk-search">
           <jdoc:include type="modules" name="search" style="none" />
        </div>
        <?php endif; ?>


Finally, open template.css file and add this code:

Code: Select all
#btn-tools,#btn_register,#btn_login,.gk_hide{margin-top:0!important}
#gk-top-nav .tools_btn { cursor:pointer; padding:0; display:block; float:left; width:16px; height:16px; border:none; text-indent:-10000px; text-align:left; background:transparent url('../images/user-tools.png') no-repeat 0 0; }


This should be the result:
custom.png


Enjoy ;)
User avatar
Platinum Boarder

GK User
Sun Feb 06, 2011 9:52 am
Thanks a lot! :)
User avatar
Fresh Boarder

GK User
Sat Feb 26, 2011 2:36 pm
open ../layouts/blocks/nav.php and add after

Code: Select all
<jdoc:include type="modules" name="breadcrumb" style="none" />
      <?php endif; ?>
   </div>
   <?php endif; ?>

this code

Code: Select all
<?php

   $user =& JFactory::getUser();
   // getting User ID
   $userID = $user->get('id');

?>

to chage text login/logout
User avatar
Fresh Boarder

GK User
Mon Aug 08, 2011 7:41 pm
If you are just wanting to add it to the navigation menu, you can do so (via Mega Menu) by opening the extended parameters tab, scrolling to the bottom and choosing "modules", then selecting the log in module from the list. This works with any module, not just the register/login.
User avatar
Senior Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.