Quote:
Originally Posted by gwerzal
Hi
Again thanks for a great mod
I have this installed on my site as a vba module but would there be any way to have a second module with different tabs.
Thank you in advance
Ben Jones
|
Hey Ben..
ok, to do multiple modules, its just a matter of some IDs (Vars and Divs) within the template..
So lets take a look at the base template:
I've highlighted in RED the VAR Name that needs to be unique for each instance (and the same within each instance).
NOTE: Pay attention to the end of each tab line as there is a VAR at the end that needs to match
I've highlighted in GREEN, the Div ID that needs to be unique for each instance (and the same within each instance).
Code:
<!-- YUI Tabs Display Start -->
<div id="tab_container"></div>
<script type="text/javascript">
var tabView = new YAHOO.widget.TabView();
YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'tabsample1.php', cacheData: false, active: true }), tabView);
YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 2', dataSrc: 'tabsample2.php', cacheData: false }), tabView);
YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 3', dataSrc: 'tabsample3.php', cacheData: false }), tabView);
tabView.appendTo('tab_container');
</script>
<!-- YUI Tabs Display End -->
So if you want a 2nd Module, you would do something like this.. (I just added the number 2 to everything to make it unique and identify it as the 2nd module.. you can name them anything you want***
Code:
<!-- YUI Tabs Display Start -->
<div id="tab_container2"></div>
<script type="text/javascript">
var tabView2 = new YAHOO.widget.TabView();
YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'tabsample1.php', cacheData: false, active: true }), tabView2);
YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 2', dataSrc: 'tabsample2.php', cacheData: false }), tabView2);
YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 3', dataSrc: 'tabsample3.php', cacheData: false }), tabView2);
tabView2.appendTo('tab_container2');
</script>
<!-- YUI Tabs Display End -->
** NOTE: Altho I said you can name them anything you want to, we need to also be careful in doing so.. for example, using myTabs will conflict with vbulletins use of the YUI Tabs within the profiles.. so come up with something unique to your site when naming these.. also, DO NOT USE TabView (Capital T and capital V) ... that is a no no as its part of the TabView Function lol.
Hope this made sense?