Closed (fixed)
Project:
Javascript Tools
Version:
5.x-0.6
Component:
Tabs
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Mar 2007 at 22:17 UTC
Updated:
21 Jan 2008 at 23:15 UTC
I have been reading on the page http://www.stilbuero.de/2006/11/05/tabs-version-2/ about how to set up tabs. I feel incredible stupid. :)
I found this code in the readme. It works, but is this how you're supposed to use Tab from the Javascript Tool module? How can I add effects to this?
$form = array();
$form['example1'] = array(
'#type' => 'tabset',
);
$form['example1']['tab1'] = array(
'#type' => 'tabpage',
'#title' => t('One'),
'#content' => t('First tab content.'),
);
$form['example1']['tab2'] = array(
'#type' => 'tabpage',
'#title' => t('Two'),
'#content' => t('Second tab content.'),
);
$form['example1']['tab3'] = array(
'#type' => 'tabpage',
'#title' => t('Three'),
'#content' => t('Third tab content.'),
);
return tabs_render($form);
Comments
Comment #1
lambert-1 commentedDitto.
Where does that code go, are there support files, what's supposed to happen, etc. etc.
Comment #2
brady747 commentedDouble ditto.
Comment #3
lambert-1 commentedI found the answer on this. Check the docs directory, which has tabsexample.module.text and tabsexample.info.txt.
Remove the .txt extensions, so Drupal can see them.
Enable the modules in the administration section.
See the _menu function in the example and go to the URL specified in the path item of the array.
A page with tabs should show up.
I'm not sure how enthusiastic I am about enabling tabs through a module, but it does work. Even better, it's the only solution I've been able to find to get more than one tabset on a single page -- I haven't been able to coerce the Drupal menuing system into doing this, though maybe there's a trick I'm missing.
Comment #4
brady747 commentedThanks lambert. Maybe I (or the others above me) wasn't clear. I've got tabs working per the code in the first post (same as your post explains I believe). But if you go to the link it has all kinds of 'effects' for the tabs. I (and I think the others above me) are trying to learn how to implement these functions example: $('#container').tabs({ fxSlide: true });
thanks.
brady
Comment #5
brady747 commentedWell...somehow in trying to add the effects from: http://www.stilbuero.de/jquery/tabs/ I managed to change something and now I can't even get my basic php code:
to show any tabs at all. Its pretty frustrating to spend hours just trying to get back to where you were. Anyhow, If anyone can at least verify for me (us) that there is a way to add effects from the link I just referenced above - for example: $('#container').tabs({ fxSlide: true }); - to jstools tabs that would at least mean I know Im not wasting my time trying to get it to work. Thanks.
Comment #6
brady747 commentedSorry to keep posting. I went back to the 'tabs' files in the 5.x-0.3 release as I found the problems others were having here: http://drupal.org/node/129216 . For some reason that has brought my php code tabs back. I'd still love to hear any info regarding the effects above.
thanks.
brady
Comment #7
nedjoThe code needed to generate tabs changed between versions. See the current dev release's readme file, http://cvs.drupal.org/viewcvs/drupal/contributions/modules/jstools/tabs/..., or look in CVS for the /docs directory, where there is a sample implementation.
Comment #8
brady747 commentedThanks very much. Sorry to not have looked there (which should have been obvious), I was to excited to just get my tabs back.
Comment #9
brady747 commentedYeah. I think I have the answer to the original posters query (if I understood it correctly...). I added
above the php and I got the effect from Klaus' demo page. Thanks to all who work hard on this. Sorry for all my posts here, but hopefully this helps the orginal poster (it certainly solves my question).
Comment #10
nedjoIIRC Klaus mentioned in an email he's planning to add support for a feature request to specify an active tab by giving it the selected class in the HTML. If that is indeed added to the tabs library, it will be simple to support it in tabs.module.
Comment #11
lambert-1 commentedWould this help solve my problem of two tabsets on one page, where a selector swaps one of the two tabsets in and out?
Comment #12
j.q commentedFollowing up with the first post: how do we load content into the tabs? I've gotten the page with tabs, but now I need to load data from previously created nodes? Any ideas?
Comment #13
wim leersNo reply in more than 6 months - closing.