Toolbar Explained

Revision as of 13:54, 28 June 2013 by Sinisakrisan (Talk | contribs)

Overview

It seems that there is a lot of confusion about what JomSocial Toolbar is and how does it work.
This article will explain what actually toolbar is and what can you expect from it.

History

To better understand the JomSocial Toolbar we need to go back in time and see how it evolved

JomSocial 1

Toolbar1.0.png

At the early stage, JomSocial had pretty much basic toolbar which was used as internal navigation system
This toolbar was very hard to manage. Including additional items to it was a nightmare for most users because it was only possible by creating plugin which will add the new set of menus, or, by hacking the core files which never was a good practice.
Toolbar with more or less this design lingered till JomSocial 1.8
JomSocial 2 brought up some massive redesign and changes in functionality

JomSocial 2

Toolbar2.8.png

Series 2 of JomSocial introduced redesigned toolbar, adding icons to the mix with tabs, notification system as well as few hard options such are returning back to "home" and "logout" but most noticeable improvement was possibility to add new menu items through Joomla Menu Manager.
This possibility however brought up new confusion which will be explained later through this article.

JomSocial 3

Toolbar3.0.png

Except redesign to fit into new JomSocial layout, Toolbar in series 3 didn't suffer any changes in functionality. It is the same old toolbar JomSocial 2 users used to, but wrapped into different style powered by Twitter Bootstrap
Because it is built with bootstrap, JomSocial toolbar is also responsive

Toolbar3.0responsive.png

What toolbar is used for?

The main purpose of JomSocial Toolbar is to provide internal navigation within component
As said in History section of this article, earlier version of JomSocial had toolbar integrated into core code and it was really hard to add new items to it. Modern toolbar allows site admin to do that easily through Joomla menu manager but, due to this fact, it often creates the illusion that toolbar can be used as any other standard Joomla menu.

Working Principle

To fully understand how JomSocial toolbar works, you will first need to disable SEF on your site. On Joomla 2.5 and above, SEF links are enabled by default, so you will have to navigate to the site backend and from dropdown menu select

  • Site -> Global Configuration on Joomla 2.5
  • System -> Global configuration on Joomla 3.x

Option Search Engine Friendly URLs must be set to No

Seo.png

Then proceed with JomSocial installation

Note on disabling SEF - it is very common practice to disable sef when you debug the navigation problems. It should be first thing to do when there is some navigation or module assignment problem on your site

After JomSocial is installed you will notice two very important things
1. JomSocial Toolbar menu is created with entire internal navigation for JomSocial

Jstoolbarmenu.png

2. Component Entry Page is created in main menu

Entrypage.png
Entry page is usually created in Main Menu. If you dont have this menu, JomSocial entry page will be created in the menu where your home page is.

We will also need to know what is the Entry page item ID
To see this, open the JomSocial link that was automaticaly created during installation and edit it

Entrypageid.png

As you can see on the image above, this menu item ID which will serve as entry page have id of 491
If we now go to any page in JomSocial component, we will notice that no matter what item in toolbar we click, this itemid will always be taken

491.png
Important - The picture above shows group page opened. It is however just for showing. ALL items in toolbar will always take the ID of Entry Page

Things to Know

  • You can have multiple entry pages If you set the menu item outside JomSocial Toolbar which will link to say.... photos page, whenever you visit photos page by using the toolbar navigation, the respective id from that menu will be taken. Again, this is why is so important to know how to properly use non-saf links when it comes to debugging. Feel free to try it
  • Toolbar items DO NOT follow Joomla ACL - Because JomSocial will always use the entry page which is available for current page, Joomla ACL does not makes sense. You will need to set the ACL on entry page level
  • Modules can NOT be assigned to toolbar items - Same as with ACL. You can't assign modules to items in JomSocial Toolbar, but you can assign them to the entry page
  • Only one level of dropdowns are allowed in toolbar - Toolbar is displayed through JomSocial template file. It is not a standard Joomla menu and it is not designed to support more then 1 level dropdown menu.

Common Mistakes

  • Setting the toolbar item as home page - JomSocial Toolbar is intended to serve as an internal navigation for JomSocial component. Setting the site home page within toolbar will always lead to unexpected behaviors to your navigation system
  • Trying to assign modules to toolbar items - It will never work, as Joomla modules are binded to itemid's. As explained above, JomSocial will always take the ID's of entry pages.
  • Trying to restrict items with Joomla ACL - Again, toolbar is not a classic Joomla Menu. We simply used Joomla menu manager to allow users to easily add new items to the toolbar which is internal component navigation'. As such it does not respect Joomla ACL as JomSocial won't support it before version 3.2 either
  • Trying to use JomSocial Toolbar as main site navigation - This is wrong by design. Toolbar is only visible to registered users by default and having it as main site navigation is bad choice.
  • Creating duplicate entry pages all over the site navigation - For example, if you have two menus outside JomSocial Toolbar menu that leads to say, all videos page, JomSocial will always take one with lower ID as entry page

Best Practices

Here are some best practices and tricks to make a proper navigation on your site

Very simple - 1 entry page navigation

This is most basic setup and hence proven to work best in every environment.
In this scenario site navigation have only one (1) entry page for JomSocial component. This is also a default setup when you first time install JomSocial
It consists from:

  1. JomSocial Toolbar Menu - With unlimited number of items within
  2. Component Entry Page - Usually created in Main Menu

Working like this, JomSocial will always take the ID of entry page

Going Complex - Adding More Entry Pages

See Also