Joomla offers the opportunity of displaying a maximum of information in a restricted space, thanks to a system of tabs. Rather than to display the data in one block, for finally obtaining pages of N screens long, it is useful to be able to organize its contents in cards, which appear in a nice way. Thus finished the interminable runs and rechargings with repetition!
Not only this displaying is practical, but it is also very simple to set up. It will be enough for you to define a panel, which will contain the various tabs (). The number of tabs is not limited, only the respect of the size of your page will impose terminals. It is also possible to display several panels on the same page, just like it is possible to display a panel inside a tab of another panel. The only thing to take care will be to specify a different identifier for each panel and each tab.
Outline the code:
// manufacturer mostabs ($useCookies)
$tabs = new mosTabs(1);
// startPane ($id)
$tabs->startPane(breads);
// starTab ($name, $id)
$tabs->startTab (Logged, tab_1);
// Contained of the first tab
$tabs->endTab ();
$tabs->startTab (Components, tab_2);
// Contained of the second tab
$tabs->endTab ();
$tabs->endPane ();
Easy way :
If you wish capacity to reload a page and to return automatically on the last visited tab, it under will be enough to assign to the parameter $useCookies of the contructor mostabs () value 1.
Disadvantage :
The only thing which we can reproach to these tabs, it is that the code is entirely integrated into the core of Joomla. It is highly disadvised going to modify the style sheets to personalize the tabs and to match them with the remainder of the site. This is why I rather recommend to reserve the use of those for the private part of your site.
Sources :
The class mosTabs is defined in the file joomla.php. As for the images of the tabs, as well as the code Javascript, you will find them in the /includes/js/tabs/ repertory.
|