While we were modifying a component to run under Joomla 1.5 native, we did notice that the component uses the class mosTabs to display it's backend content in several tabs. Since mosTabs is not available anymore in Joomla 1.5, here is the solution we found.
You must include this line of code before attempting to call tabs functionality:
jimport ( 'joomla.html.pane');
Then get the instance for the tabs and assign it to a variable as displayed below:
$myTabs = & JPane::getInstance ( 'tabs' );
From here, everything is quite easy. Simply use the code below to insert the required code to get the tabs rendered in the component's area:
// Start the tabbed content, include this line ONLY ONCE
echo $myTabs->startPane( "my_tabbed_content" );
// Start the Tab1 definition
echo $myTabs->startPanel("Tab1 Title","tab1-id");
// Here you can display the content for Tab1
// Close the Tab1 definition
echo $myTabs->endPanel();
// Start the Tab2 definition
echo $myTabs->startPanel("Tab2 Title","tab2-id");
// Here you can display the content for Tab2
// Close the Tab2 definition
echo $myTabs->endPanel();
// Close the tabbed content, include this line ONLY ONCE
echo $myTabs->endPane();
A nice variant for tabbed content is slider. To display your content in sliders just get the instance for 'sliders' instead of 'tabs' as shown in the following line of code:
$myTabs =& JPane::getInstance( 'sliders' );
Source: joomlaportal.de
Want to earn a new revenue stream? Join our Affiliate program today! For each purchase you generate, you receive a huge percentage of the sale price.
Do visit our blog, where we continue to provide useful tips and handy hints to use, customize and develop Joomla on your websites.
Comments
I have used it . But it is not seems to working . SO i have searched it and find this .
http://docs.joomla.org/How_to_use_the_JPane_classes_in_a_component
RSS feed for comments to this post.