0

I need your help. Is it possible to add the jomsocial toolbar to a module in joomla 3.0 programmatically? In the past (Joomla 1.5 / 2.5) a few different methods worked but I guess upgrades changes this. I have searched high and low and tried every method I know. Thanks in advance!

This is my code that used to work:

// TOOLBAR ////////////////////////////////

require_once( JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php');
CFactory::load( 'libraries' , 'toolbar' );
$toolbar_lib = CToolbarLibrary::getInstance();
print $toolbar_lib->getHTML(_showMiniHeaderUser);

// (END) TOOLBAR ////////////////////////////////

This code is the common way:

require_once( JPATH_BASE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php');
require_once( JPATH_BASE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'toolbar.php');
$toolbar    = CToolbarLibrary::getInstance()->getHTML();
echo '<div id="community-wrap">' . $toolbar . '</div>'; 

Neither of these methods work in jomsocial 3.0 or joomla 3.0 anymore and Jomsocial documentation doesn't offer any suggestions.

Flippinmonk
  • 1,029
  • 2
  • 8
  • 6
  • Something you would be best off asking the developer on JomSocial. I can't access this page as I haven't got JomSocial but login and have a look at the API: http://documentation.jomsocial.com/wiki/Toolbar_API – Lodder Nov 05 '13 at 21:58
  • @Lodder Thanks for the response, I've taken a look at the API link you sent, and it doesn't offer any documentation on implementing the toolbar just manipulating it. – Flippinmonk Nov 05 '13 at 22:17

3 Answers3

0

your answer is herer: i think it is also free and support js 3.0

http://www.knuddelesel.de/en/downloads/viewdownload/4/2.html

sdfsdf
  • 1
  • 1
    Note that [link-only answers](http://meta.stackoverflow.com/tags/link-only-answers/info) are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Feb 09 '14 at 12:16
0
<p>/**<br />
  Start Jomsocial Toolbar<br />
*/</p>
<p><br />
  if(JFile::exists(JPATH_ROOT . '/components/com_community/libraries/core.php'))<br />
  {<br />
  require_once( JPATH_ROOT . '/components/com_community/libraries/core.php' );<br />
  require_once( JPATH_ROOT . '/components/com_community/libraries/toolbar.php' );<br />
  $appsLib    = CAppPlugins::getInstance();<br />
  $appsLib-&gt;loadApplications();<br />
  $appsLib-&gt;triggerEvent( 'onSystemStart' , array() );<br />
  if( class_exists( 'CToolbarLibrary' ) )<br />
  {<br />
  echo '&lt;div id=&quot;community-wrap&quot; style=&quot;min-height: 0 !important;  height: auto !important; margin: 0 !important;&quot;&gt;';<br />
  if( method_exists( 'CToolbarLibrary' , 'getInstance' ) )<br />
  {<br />
  $jsToolbar  = CToolbarLibrary::getInstance();<br />
  echo $jsToolbar-&gt;getHTML();<br />
  }<br />
  else<br />
  {<br />
  echo CToolbarLibrary::getHTML();<br />
  }<br />
  echo '&lt;/div&gt;';<br />
  }<br />
  }<br />
  /**<br />
  End Jomsocial Toolbar<br />
  */ </p>
InnocentKiller
  • 5,234
  • 7
  • 36
  • 84
0

I've been trying to do the same for a while, very much frustrated there's no info in official docs, and eventually I came across this. It helped me a lot, thanks! Your solution actually works:

include_once JPATH_ROOT.'/components/com_community/libraries/core.php';

$toolbar = CToolbarLibrary::getInstance()->getHTML();
echo '<div id="community-wrap">' . $toolbar . '</div>';

Using joomla 3.3 and jomsocial 3.2

LuckyLizard
  • 415
  • 3
  • 13