How to focus a TAB after a FLEXIcontent view loads

More
11 years 5 months ago #44174 by ggppdk
Hello

-- if you use firebug you will see that
e.g.
the subtitle tabset has an HTML TAG ID 'fc_subtitle_tabset'


-- so if the above tabset has 5 tabs:
0,1,2,3,4

then to focus the last tab 5, you can use the following JS code:
Code:
fctabber['fc_subtitle_tabset'].show(4);



e.g. if you have variable in the url:
&fc_subtitle_tabset_no=4

you can use PHP code:
Code:
$fc_subtitle_tabset_no = JRequest::getInt('fc_subtitle_tabset_no'); if ($fc_subtitle_tabset_no) { $js = " jQuery(document).ready(function(){ fctabber['fc_subtitle_tabset'].show(".$fc_subtitle_tabset_no."); }); "; $document = JFactory::getDocument(); $document->addScriptDeclaration($js); }

NOTE: i have not tested the above code


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #44187 by mtgt
Hi,

I don't know if I doing this well :oops: , here are what I have done.

I add the following code at the beggining of the tabs in item.php
Code:
<?php $fc_subtitle_tabset_no = JRequest::getInt('fc_subtitle_tabset_no'); if ($fc_subtitle_tabset_no) { $js = " jQuery(document).ready(function(){ fctabber['fc_subtitle_tabset'].show(".$fc_subtitle_tabset_no."); }); "; $document = JFactory::getDocument(); $document->addScriptDeclaration($js); } ?>

Then I add in the tabs code $fctabber.show(x); like here in tabs4
Code:
<?php echo FLEXI_J16GE ? // start of next TAB ... JHtml::_('tabs.panel', JText::_('FLEXI_FOURTH_TAB'), 'lien' ) : $myTabs->startPanel( JText::_('FLEXI_FOURTH_TAB'), 'lien' ) ; $fctabber['fc_subtitle_tabset'].show(4); ?>

then I try to call the tab but I am redirect to another page which is category Asia :roll:

I probably misunderstood something
Sorry

Greg
"La vie n'est qu'opportunité !" ;-)

www.nomadsroad.com Nomads Road - Une aventure interactive autour du monde
www.voyage-australie-nz.com Infos pour préparer son voyage en Australie et en Nouvelle-Zélande

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #44188 by ggppdk
Hello

the code i gave you is for focusing TABs included in FLEXIcontent templates which are NOT created via Joomla JHtml class

-- see the tabbed position(s) in flexicontent templates


-- use firebug to see the HTML TAG ID of every tabset container

an HTML tag ID is a parameter in an html tag, you see inside the code:
e.g.
Code:
<div ... id="fc_subtitle_tabset" ...>...</div>


-- you need to add a variable in your URLs to say which tab to focus, i said
&fc_subtitle_tabset=4
but you can use anything you think appropriate



If you want to focus Joomla created TABs via JHTML, please google it or ask in Joomla forums

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.307 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save