728x90-banner.png

Add Logout Link to JomSocial Menu

August 4, 2009 · View Comments

After about an hour of Google-Fu and some serious command line searching, I finally came up with how to add a logout link to your JomSocial menu so that it will appear on every page. Pretty simple, now that I know how to do it – but isn’t that how everything works? Here it is.

$defaultCoreMenuArray['Logout']  = $this->_addDefaultItem(
JText::_('Logout'),
CRoute::_('index.php?option=com_user&view=login')
);

Gain access to your components/com_community/libraries/toolbar.php (either via ssh or ftp) and add the above line of code starting at line 60, right below where it says:

switch ($key)
 {
 case TOOLBAR_HOME :
 $default->caption  = JText::_('CC HOME');
 $default->link  = CRoute::_(index.php?option=com_community&view=frontpage');

and your all set. You now have a Logout option under your home menu for JomSocial! Play with it a little bit, and you could potentially move the menu to the end of the line, so that it shows as a standalone top-menu item.

Logout menu shown for JomSocial

Logout menu shown for JomSocial

Enjoy!

  • Abc
    where is toolbar.php toolbar.php toolbar.php toolbar.php toolbar.php toolbar.php
  • the toolbar.php file is located at (joomla_root)/components/com_community/libraries/toolbar.php
  • Safa
    I can't find that toolbar.php ???
  • Napster
    the toolbar.php Location:- joomla\components\com_community\libraries\toolbar.php
  • great work done man... that easy my tension...
    thanks a lot... :)
blog comments powered by Disqus

Previous post:

Next post: