The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
AJAX Tabs Content Script - Version 3.0 (YUI) Details »» | |||||||||||||||||||||||||||||
AJAX Tabs Content Script - Version 3.0 (YUI)
Developer Last Online: Nov 2023
AJAX Tabs Content Script - Version 3.0 (YUI)
This is written for implementation within both vBa CMPS AND within vbulletin (can add to any existing vbulletin template or custom template for use on custom vB pages) Description/Whats changed within this new release?: This newest released version is based on YUI TabView http://developer.yahoo.com/yui/tabview/. NOTE: This is an initial release with some of the basic features of YUI TabView. More Powerful Enhancements Addons/Enhanced Configuration settings will be released as soon as I write them up. I already have multiple enhancements underway. All Content Files that have been release with previous versions still work. Note: I've included sample content files in the attached Zip File to use with the step by step how to. THE BASICS TO GET YOU STARTED The Following 5 easy steps will get the base system installed. Once you have the base system installed and tested, then move onto the Advanced Customization Steps. Step 1. Upload the clientscript directory (located in the attached Zip File) to your vbulletin root directory (This will add all the new YUI files to the existing vbulletin clientscript/yui directory). Step 2. EDIT and Upload the 3 sample content files (located in the SAMPLE CONTENT FILES FOLDER within the attached Zip File) to your vbulletin root directory. NOTE: Edit the 3 sample content files to change the MODIFICATION CONTROL OPTIONS (starting at line 31) for your testing (mainly the ForumIDs so you can see sample result data) NOTE 2: For those of you that have used previous versions, you can use your existing content files. (simple edit the template in step 4 to use your existing content files to test instead of the samples) Step 3. Add the below code to the end of your HEADINCLUDE TEMPLATE. Code:
<!-- YUI CSS for TabView --> <link rel="stylesheet" type="text/css" href="clientscript/yui/tabview/assets/tabview.css" /> <link rel="stylesheet" type="text/css" href="clientscript/yui/tabview/assets/tabview-skin.css" /> <!-- JavaScript Dependencies for Tabview: --> <script type="text/javascript" src="clientscript/yui/utilities/utilities.js"></script> <script type="text/javascript" src="clientscript/yui/element/element-beta-min.js"></script> <!-- Source file for TabView --> <script type="text/javascript" src="clientscript/yui/tabview/tabview-min.js"></script> <!-- Source file for Dispatcher --> <script type="text/javascript" src="clientscript/yui/tabview/dispatcher-min.js"></script> STEPS 4 and 5 are for vBa CMPS Use Only.... Skip these steps and follow the ALT Step for vB Pages. Step 4 (FOR vBa CMPS ONLY). Create a new TEMPLATE Module. Module Title: What ever you want to name it.(ie, Tab Content) Template to Include: What ever you want to name it (ie, Tab_Content_Main) Select the Styles you want it added to. Template Content: Paste the below code into the box. Use Module Wrapper Template: NO Usergroup Permissions: Set your perms to your liking 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 --> Step 5 (FOR vBa CMPS ONLY). Add the New Module to a page and test it out. You should have a Tabbed Module with 3 Tabs (tab 1, tab 2 and tab 3) and all 3 should display a layout similar to the Recent Threads Module (unless you used your own custom content modules). ALT Step for vB Pages(To Use on any vB Page). Simply add the following code to any vBulletin Template for where you want Tabs to display. 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 --> ADVANCED CUSTOMIZATION Now that you have the new base system installed, its time to Customize the Tabs. Customization includes CSS to match your style(s), Controlling the Tabs and Custom Content for each Tab TABS To control the tabs, you will need to modify the template created in Step 4. Lets examine a tab (the line of code in the template for each tab). The first example is for the ACTIVE tab (the one that is launched when the page is first displayed). The 2nd is for all other tabs since you only have one active tab. What you need to be concerned with is what is inside the {} (I've highlited this in RED) lable: This is the Display Name of the Tab dataSrc: This is the content file associated with the specific tab cacheData: This allows you to control whether the content from the dataSrc is to be cached or to be called each time the tab is selected. Set this to false if you want the data to be updated when you click on the tab. Set it to True if you want the data to be cached upon page launch active: true .. only use this for the first tab. ACTIVE TAB EXAMPLE Code:
YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 1', dataSrc: 'tabsample1.php', cacheData: false, active: true }), tabView); Code:
YAHOO.plugin.Dispatcher.delegate( new YAHOO.widget.Tab({ label: 'tab 2', dataSrc: 'tabsample2.php', cacheData: false }), tabView); CSS You will probably notice that there are TWO CSS Files that are being called in the HEADINCLUDE template (tabview.css & tabview-skin.css). I broke the CSS into two files so that the control elements that SHOULD NOT be edited are contained in one file (tabview.css) and the control elements that CAN be edited are in the other (tabview-skin.css). I made plenty of comments in the tabview-skin.css file that should help you change the tab colors to match your style. Just simply look for the Color Elements and match them to the color elements of your Styles CSS. I am FAR from a CSS guru.. I learned by playing around with the settings The tabview-skin.css file is located in: clientscript/yui/tabview/assets/tabview-skin.css Content Files Please see posts 2&3 of this thread for additional enhancements. Members are encourage to provide their custom content file for inclusion in Post 3. Download Now
Show Your Support
|
3 благодарности(ей) от: | ||
caoducanh9x, kotkerk |
Comments |
#82
|
||||
|
||||
Quote:
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 --> Hope this made sense? |
#83
|
||||
|
||||
Quote:
|
#84
|
||||
|
||||
Great mod, working great, thankyou.
Only problem I have seen is that under Firefox (2) the tabs themselves take on a life all of their own As you'll see from the images below one tab will assume it's natural form, whilst the other two get severe vertical belligerence! Where do you think I should look for an issue fixer for this? Firefox itself or maybe somewhere else? Many thanks in advance |
#85
|
||||
|
||||
Quote:
|
#86
|
||||
|
||||
Quote:
the two blocks of CSS that effect that are (settings highlited in red.. lines 30-31 (Raises from the set height) Code:
/* raise selected tab */ .yui-navset .yui-nav .selected a em {padding:0.4em 0.6em;} lines 16-23 (specifically line 20) (default set height) Code:
.yui-navset .yui-nav li a em { border-top:solid 1px #a3a3a3; border-bottom:0; cursor:hand; padding:0.2em 0.5em; top:-1px; /* for 1px rounded corners */ position:relative; } |
#87
|
||||
|
||||
Many thanks for the really fast response. Worked a treat
|
#88
|
||||
|
||||
I loved the TFH, but this is more suitable for me. I'll be loading it up on the dev site and testing it out asap. Nice work Bob!
|
#89
|
|||
|
|||
Is it possible to show per category? Not threads but topics..
|
#90
|
|||
|
|||
Just want to share my experience,
I think this mod assumed that cmps resides inside vbulletin root folder. I have my cmps file 1 folder up from vB, and i can not get this working by following original instruction. After a lot of trial and error I finally geit it working by changing path in the template to point to the content php files. Then after that also need to edit content files to add required path. hope this is useful for somebody *ps: bobster65, if this is not how you intend it to be can please let me know what is the correct approach ? Thanks ! great mod ! |
#91
|
|||
|
|||
Can I use it?
NEW GARS 02-07-2008 - https://vborg.vbsupport.ru/showp...&postcount=113 - GARS Content File - ZiG |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|