Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By worthy on
I'm trying to implement tabs through the Javascript Tools Module. I've read through everything I can find, but I don't know where to start. I know html and css well but I'm just getting started on PHP and Drupal. The implementation on a normal site is very simple, but I just don't know where to get started to call the function theme_tabs_tab_page.
Do I need to make a new content type where I input these "calls"? I've tried adding the link to the tabs javascript and css files in page.tpl.php as explained here, but that does nothing in Drupal.
Thanks,
Neum
Comments
Sample usage
* enable the tabs module
* enable the page module, log in as a user with admin access, and create a new piece of content ('node') of type 'page'
* for 'Input format', select 'PHP code'
* put the following as the page's content:
It Works!
Thank you for that, it works great. For some reason I could not get it to work if I was using tinyMCE, even having the input set to PHP code. I tried putting the code in the html popup of tinyMCE and several other changes but it wouldn't work. So I disabled tinyMCE and it works great.
Thanks again.
Error messages
Glad it's working, but I'd like to track down the tinyMCE conflict issue.
If you have a moment, please reneable tinyMCE, view the tabs page in Firefox, and look for Javascript error messages (Tools > Javascript console). Is there anything there?
Thanks.
Tiny MCE Errors
I finally got a chance to reenable tinyMCE and there are javascript errors. There is a bunch of them as soon as I go to add a page node.
Some of these are
Error: Unknown property 'filter'. Declaration dropped.
Source File: modules/tinymce/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css
Line: 139
and a bunch more like that. It's doing really weird things, after I try and add the code to the html pop-up area. After I add the code tinyMCE disappears and it is just the standard editor. I think that my tinyMCE install somehow got corrupted. I'm going to uninstall it drop the tables and then I'll set it back up again and let you know how it goes.
Thanks for the fast answers.
tinymce
and most of the other wysiwyg's you have to turn off or view 'source/html' mode and paste it then. if not, tinymce strips and chops the code... ;)
-kpaul
Switching Themes
Any idea how I could go about switching the tabs css theme?
The module has settings for various
see admin/settings/tabs or you could edit the files in tabs/css.
Even for drupal 5.x?
Admin/settings/tabs goes no where for me in D5. Is that still supposed to be there? I have functioning tabs on my site, I'm just looking to change the look of them so that they have lines around the tabs, making them look more like tabs.
I don't know css very well so any help would be greatly appreciated. I've already spent hours trying to do this!
Just what I needed!
I got the heads up about this AJAX module from Zack@CSL. Anyways, this was what I needed to implement this module for the site I was working on. Extended this a bit to include information on how to draw in other nodes:
http://www.openconcept.ca/fun_with_drupals_ajax_tabs
The last think you want to do is set up AJAX tabs that your site admins can't administer through their WYSIWYG tools.
Mike
--
Mike Gifford, OpenConcept Consulting
Free Software for Social Change -> http://openconcept.ca
http://learningpartnership.org http://ox.ca http://poped.org http://openoffice.ca
I would suggest an
I would suggest an alternative based on mgifford's code to pull other nodes into tabs. Sometimes you don't want the whole themed node, because it may contain structure and style that messes up the tabbed display. I had this problem with the Multiflex theme: using the "themed node" approach, I basically got a node within a node, with several repeated divs, etc. and the tabset only displayed at a height of about 1 text line, while the node body text overflowed below it. It looked awful.
The solution was to pull in only the node *body* as follows:
(Compare with mgifford's original code):
[For other newbs: the code has to go into a node (e.g. a page) with input type set to PHP.]
How would I pull nodes into tabs with v5.0
How would I convert the above code to pull nodes into a tab??
Who Am I?? www.joeliang.ca
Problems loading nodes into tabs (drupal 5)
Hi,
I can get the tabs to work, I cant however get them to load nodes:
I want 3 tabs on a page, each one pulling in a different node, to form pages with grouped info.
Any ideas how I would achieve this ?
Thank you kindly.
Shaun
How to do for drupal 5?
Hi,
Any idea how would I do this in drupal 5?
Thank you kindly
Get content from node ID in drupal 5.x?
How this is done in drupal 5.x?
-najibx-
Try these modules
1. http://drupal.org/project/views_tabs
2. http://drupal.org/node/160392 (currently a patch, likely to be adopted soon in Panels module)
change with above code
it works good.......
Associate Architect
Indecomm Global Services
How would I create tabs for
How would I create tabs for the fields I have in a view/block.
thnx
this does not work for me.
this does not work for me. Possibly because I'm usinf drupal 5, but i get this error:
For 5.0...
... the way it's used has changed. This should work:
This is really cool
Thanks for this Nedjo, this tabs function is a great addition and works like a dream.
Do you know whether the other variants of tab styles as shown in the demo at, http://stilbuero.de/jquery/tabs/ are available to Drupal and if so, any pointers on how to access them?
Regards
Chisel
Does this work for 5.7
Hi Nejdo,
I have tried using this with drupal 5.7 and it does not seem to work. Could you please tell me how to put tabs in content items for Drupal 5.7 ?
I have got it working with the tabs_render function as outlined in the comment http://drupal.org/node/62998#comment-860448 .
However, it would be much better for me if I can just use the method you suggested instead of using form API.
Thanks,
it doesnt works on drupal 5 2
In drupal 5.2
I enable the tabs module
and enable the page module, log in as a user with admin access, and create a new piece of content ('node') of type 'page'
* for 'Input format', select 'PHP code'
* put the following as the page's content:
:
and it didnt work..? please help me what to do..
For 5.x, see above on this page
http://drupal.org/node/62998#comment-189583
Or, if you're using the Forms API, see the sample module that's included in the 5.x dev and HEAD downloads,
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/jstools/tab...
A Step By Step?
I'm just about pulling out my hair right now. I simply do not have the guts to pull this off or something. Here's what I've done so far...
[1] Downloaded: Javascript Tools
[2] Uploaded To "Modules"
[3] Enabled Module "Javascript Tools"
[4] Enabled Module "Tabs" Under Javascript Tools
[?] What's the "Page" Module, I have none called this.
[5] I entered your php code above, what I got was this.
In IE it shows up as a list.
I must be an idot or something.
I just can't get this one to work.
Give me a checklist please or some
tips or something. I just want some
tabs, lol. I've been through every
tab reference I can think of on Google
and I just can't get the thing to work.
Much appreciated.
» Respectfully, GreenLED
»
Place blocks inside tabs
A Drupal noob, I can't figure out if it's possible to place the content of two or three blocks into this Javascript tabbed pane.
For example, I've gotten the tabs to work--nice module, by the way--with simple text content in block made on-the-fly. But what I'd like to do is take the content of three blocks and put one in each tab.
For example, I'd like to make tab 1 contain the content presented by "Highest Rated Nodes" module/block, make tab 2 contain the content presented by "Most voted for nodes" module/block and make tab 3 contain the content generated by the Poll module/block.
I'd like to do this without hacking any of the modules themselves.
Ideas?
Thanks!
In a theme
This sort of thing you'd do in a theme. Edit e.g. a page.tpl.php file for a PHPTemplate theme. You'd make the tabs manually rather than through a theme() call. Copy the HTML rendered for a tabset, and then for the tab page content put your block. You'd need to test for each block, incrementing an index counter only if there was content for the block.
Possible to link to specific tab?
Is it possible to link to a tabbed page but also to have a specific tab selected? If so, how would I do that?
This is a great module by the way, I'm using a couple of items in it and they work great!
Please open support request issue on the module
That way the module author is more likely to find the request, and others are more likely to see it.
Being new to Drupal
I don't even know where to file a support request issue on a module. I've gone to the javascript tools module page and I don't see anything like support request. Is it request new feature? or report new bug? When I click on support forum it just takes me to the main forum tree. I couldn't find a forum specifically for javascript tools, but like I said I'm new to all this.
I'll try and put it as a feature request, but please correct me if that's the wrong spot. I'm not trying to make this hard for anyone.
Thanks again for all the help.
Found where to make a module support request
It's on the module page and just click the link "view pending feature requests" and there you can add one. (For those other noobs who don't know where to find this stuff)
It has been added.
A real newbie to drupal
I have tried and tried to get tabs to show up. Dont know what else to try, I have tried most all of the stuff here. Been to the links in the post and went to jquery website and read it. Messed with some of the other stuff it can do with no problem, just cant get this tab thing down.
I have put this in the head of page.tpl.php (Aquasoft thme) Drupal5
/misc/jquery.js
/modules/jstools/tabs/tabs.js
$(document).ready(function() {
$.tabs("container");
I am using front page module and put this in there.
div id="container"
ul class="anchors"
li a href="#Site-News" Site News /a /li
li a href="#Inbox" /a /li
/ul
/div
and then separate nodes one as #site-news and #inbox
is this right? I would greatly appreciate any help!
Like i said a real newbie please be easy on me.
How to integrate into User Profiles Version 2?
Hi there,
could somebody please explain how to implement this modul into "User Profiles Version 2" (http://shellmultimedia.com/tutorials/user-profiles) as I have no clue which file I have to edit that this module is shown up correctly?
Do I have to edit "template.php" or perhaps "node-uprofile.tpl.php"?
Thanks in advance for giving a hint.
SirBerberitz
I am looking at the same .. just starting
But, I have been doing tabs (provided by JS tools) together with tab panel + panel mini + panel. User Profiles Version 2 would be nice to be presented in tabs isn't? Michelle is planning to come out with User Profiles Version 3, is she planning to use tabs?
-najibx -
Drupal developer in Malaysia
Question about pages
As I see above majority of the code are based on nodes. What I've been searching for is a way to insert "pages" such as the faq into a tab. I've tried the views and the panel modules but they don't have that as options. I was thinking of creating a page with tabs leading to differnt types not just nodes. So far I've been unsuccesfully in my trials.
Use Panels 2
and the panels tabs style module, http://drupal.org/project/panels_tabs
Please Post Code for Drupal 5.5
can one of the real drupal wizards please post nedjo's code (item 2 of this thread) updated so that it works with drupal 5.5? would be very much appreciated... thanks a lot
I tested nedjo's code on my
I tested nedjo's code on my drupal site (5.6), it works pretty well. Have you changed example to the name of what you are trying to tab?
$output = theme('tabs_tabset', 'example', $tabs);
Hi , Could you please tell
Hi ,
Could you please tell me the exact usage for this to get it working in 5.6 or 5.7 .. ? What do you mean my changing the name of example to what you are trying to tab ? How can I just get a few tabs in my content item ?
Thanks,
Knariks
Image instead of text
I have been using the following code on my drupal 5.6 site and it works perfectly. My question is can you use an image for the tab, instead of just the text?
For example, instead of having the tab just display "Online Products" (from the code below) have it display a nice rounded button with fancy lettering to display "online products"
(the code I am using)
subscribe?
can I subscribe to this thread? I'd love to know how to do this too!
Thanks!
Scott
Scott Rigby
http://basekamp.com
http://PlausibleArtworlds.org
http://UtopiaSchool.org
Using this code with D6 but for block instead of node?
I've been using this code with D6 to display nodes in tabs. How could I adapt this to display block instead of nodes in differents tabs?
Thank you!
jquery tabs with blocks...
Anyone ?
This is what I did:
You can go to this page in a test site I'm building and you'll see tabbed pages with the tabs from the jquery tabs plugin: http://forensic.ipwa.net/node/11
I used the code you posted to call nodes inside my tabs, it works well in most browsers except IE6. In IE 6 the whole page shifts when you click the second tab, any help to solve this would be greatly appreciated.
For the jquery tabs plugin style to work I had to hack the tabs module a little bit, in the tabs.module I changed the function that returns the rendered tabs in lines 118-135.
From:
To:
The changes I made was to change the anchor class to tabs-nav. The other change was to add a span inside the link on the list items, this is how the CSS applies the main background for the tabs, they use the sliding doors technique.
The next step was to download the plugin at: http://stilbuero.de/jquery/tabs/
Open the jquey.tabs.css and copy all the css and add it to your theme's css, or copy the file and call it from your template, also copy the tabs.png image to your theme folder.
I changed the tabs-nav class on the CSS:
From:
To:
You may need to adjust the height.
HTH
Nicolas
-------------------------
http://nic.ipwa.net
Nicolas
-------------------------
cool ! it works
thanks ipwa
cool!
I'm glad it helped someone!
Cheers!
Nicolas
-------------------------
http://nic.ipwa.net
Nicolas
-------------------------
not working for me
hi
I installed jstools and activated the tab module.
I disabled fckeditor.
I test that my user belongs to "admin" role who has access to the php-input format.
then I create a new page, select php as input format but the page keeps blank, I cant see anything on it. I have tried different examples on this post.
I am using drupal 5.7 and the last version of jstools.
¿any clue about what I am doing wrong??
many thanks in advance for any help.
I don't know much about that
I don't know much about that module, but I can tell you -- from my own experience the tabs created by this module are not really -- at least for me -- up to my standards -- they don't show up as I expected them too. If you're expecting them to show up just exactly like the tabs do for example when your administrating -- they don't. I would recommend using Views to create tabs. What's nice about this method is you ONLY need Views, and yes CCK. If you want a detailed way to do it, let me know and I'll post it here. Just thought I'd mention it.
How to create Tab using Views?
Hi GreenLED,
I'm new to Drupal and I've been spending hours trying to create tabs using Views but have no luck :(
I would like to do both:
1. divide the content of a node into multiple tabs
2. put contents from different nodes into multiple tabs of a page
Appreciate if you could give me some detailed steps as I'm still having hard time to understand Durpal completely.
Thanks!
I fele your pain. I was
I fele your pain. I was quite frustrated with JavaScript tools -- to say nothing of disappointed because it did not deliver what I was expecting. The best way to get some more confidence in Drupal is with examples... Therefore ... create a new view. I've listed the settings below. Match up the settings with the listed secitons. You'll get it once you get going. So, open a window now pull up "Views" and hit add ... then start popping these settings in there...
Don't try to figure it out yet -- just start inputting . . .
1: Create The Content Type -- Create a content type with the following settings.
The rest disable or set to your liking.
2: Create Your Fields -- Create 3 cck fields with the following settings.
Once you've created the first field. The next two are exactly identical. Simply replace event_guests with event_schedule and event_details. Don't worry about settings that I have not noted. Just fill in the ones I have. So, when you're done you'll have a total of 3 fields in your "Event" content type called "event_guests, event_schedule" and "event_details"
Ok. Now that where done with that... Go ahead and input some fake data into a node. So -- "Create" > "Event" Once you've inputted some imaginary data -- view the node to make sure it go in there. Next -- follow the next steps below. Now that we have our data -- we're simply going to play around with how it appears... The fun part basically...
3: Create Your Views -- Create 2 views with the following settings. What you want to do here is create one view with the following settings, then simply clone that view and adjust the noted names ... I'll explain below.
( basic information )
( page )
( menu )
( arguments )
( filters )
By creating this tab we've now designated a specific view for one tab. Go ahead and create 1 more views with the exact same settings -- making sure to replace every instance of "schedule" in your view with "details" Do you follow?
Ok. Now we're almost home. There is ONE more thing you have to do for this to work. After creating all of this stuff what you're going to end up with is a node with 3 tabs that has the exact same content on each page. Now we need to somehow format it so that when you are on a particular tab you get only what you want to see. Open your FTP client or get to the folder in your install named /themes/your-theme-name/
You should have a file called node.tpl.php. Download a copy of it. Rename the file to "node-event.tpl.php" The name IS important. Now what we're essentially going to do is tell drupal what to show on each tab. Copy and paste the following code into your file (node-event.tpl.php) making sure to completely delete everything that's currently in there. Then copy and paste the following.
Keep in mind I have not tested any of this and you'll have to definitely get back to me with errors or what-knot. However, you'll enjoy these tabs when they are all working. You can view a live working example that I'm using with this setup right here The only "glitch" with this setup is that you have to change one little string in the node.module to edit the title of the "View" tab (you'll see what I mean later) to make it read what you want. Also, this setup does not really work well if you have multiple content types that you want to have ... well -- well take about that when it comes to it -- just try the above and we'll go from there.
Awesome!!
Thanks for the wonderful step-by-step guide!! it works flawlessly.
I wonder how the view that I created knows about the content type that's being applied to? is it by "-event" in argument "$node-event"? I've been trying to do the same thing by playing around Filters (Node: Type), was I going totally the wrong way?
I've been struggling with Views but the more I discover , the more I like it!
p/s: a closing curly bracket is missing for Case statement in the code.
Those closing brackets get
Those closing brackets get me every-time. Thank goodness for error-reporting. *two thumbs up* I'm really geeked that it all worked for you. Enjoy. I'll answer in more detail in a little while. Enjoy!
I found another way...
Hi GreenLED,
thanks again for the awesome guide! It gave me much better ideas of what Views is.
I think I found another way of creating tab using Views without coding on node-xxx.tpl.php
Following all your steps except for the settings below:
1. choose "Table View" instead of "Full Nodes"
2. In Fields section, add the field (eg. event_details) which you want it to be the tab's content
And, You will get a tab with the field's content you chose above.
Anyway, I am still looking forward to hearing from you regarding my questions in the previous post. I'm still in the progress to fully understand Views.
Anytime... You are correct.
Anytime... You are correct. I actually used "List View" a while ago. The reason I did it the way I describe because I had a specific layout in mind and I did not want to go into "Theming Views" so I simply used the "node-x.tpl.php" route, but yes -- you can do that. You will find views to be insanely helpful.
» Respectfully, GreenLED
»
Thanks, this is extremely
Thanks, this is extremely useful !
facing the same problem
I'm facing the same problem too...using Drupal 5.7 and latest jstools. Could not get it work, the page is blank
Try looking at this comment
Try looking at this comment in this discussion.
» Respectfully, GreenLED
»
Node edit form on a javascript tab
Does anybody know what is the simplest way of displaying a node edit form on a javascript tab?
I have the main node displayed on the first tab. Then I have a couple of other related nodes displayed on the other tabs. I want to have another tab to display the node edit form of the main node. How would you go about this?
Personal Website
Company Website
I think
Try ...
CCK Fieldgroup Tabs - Display CCK fieldgroups in tabs. Enables splitting up content onto tabs in both editing and display.
Depends on: Fieldgroup (enabled), Tabs (enabled)
Hope this help.
-najibx -
Drupal developer in Malaysia
Awesome!!
(reply to http://drupal.org/node/62998#comment-815359)
Thanks for the wonderful step-by-step guide!! it works flawlessly.
I wonder how the view that I created knows about the content type that's being applied to? is it by "-event" in argument "$node-event"? I've been trying to do the same thing by playing around Filters (Node: Type), was I going totally the wrong way?
I've been struggling with Views but the more I discover , the more I like it!
p/s: a closing curly bracket is missing for Case statement in the code.
Another project
Sorry if i come late.
I was looking for tabs and i did found this module:
http://drupal.org/project/tabbed_block
:)
Byron H.
Simple example - Tabs working in Drupal 5.3
Hi folks,
my first posting. Excuse me I am new to this. After days of hacking and reading I have finally got tabs working (at least in Drupal 5.3). The key step I was missing was to render the tabs. I don't know if I have to call the tabs_load() function. But thank God ... finally something that works. I just included this code in a simple Page, enabled PHP etc. Thanks and acknowledgements to other posts from which this code is 'hacked' together.
Have you guys checked out my
Have you guys checked out my comment about creating tabs with cck and views? I think it will make you quite happy to find that you can create [b]system-like[/b] tabs without having to even install javascript-tools. Check it out »
» Respectfully, GreenLED
»
CCK Multi-value array in tabs
Hey everyone,
anyone know how to do properly print the array of CCK multi-value fields inside the jstabs? See issue here: http://drupal.org/node/304152
This is extremely useful !
This is extremely useful ! thanks !
(to GreenLED)