Hi, since you can use nodes as tab, a more useful way to control what nodes becomes tabs is through views. It would be very nice if I can set things that way. Thanks. :)

Comments

pasqualle’s picture

Title: Views to load nodes as quicktabs? » Views style plugin to display list of nodes as quicktabs

interesting idea, and it is a quite easy thing to do..

Flying Drupalist’s picture

Thank you so much for this. :) Will solve a lot of problems of mine.

Flying Drupalist’s picture

Hi, is this still in the cards? I know that there's a views tab display, but it has nowhere near the functionality of quicktabs. Or am I supposed to use that instead?

Thanks.

pasqualle’s picture

I would like to include this in the 3.x version as all the nice features already in the issue queue. I wish to have more time to work on this module..

Flying Drupalist’s picture

Thanks, all the changes you made have helped me greatly so far, so I'm very appreciative. But I'm very much looking forward to 3.x

pasqualle’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev

Moving new features to 3.x version

Flying Drupalist’s picture

Yay thanks! :D Can't wait.

add1sun’s picture

Status: Active » Needs work
StatusFileSize
new2.96 KB

This is totally not at all a working patch, but just a start to get the views hooks and files in. The whole, you know, rendering/theming as quicktabs still needs to happen. This is also against 2.x dev since 3.x doesn't seem to be doing anything atm.

quicksketch’s picture

Assigned: Unassigned » quicksketch

I'm taking add1sun's patch and running with it. We should have something working in a short while.

mohirt’s picture

Subscribe!

quicksketch’s picture

Status: Needs work » Needs review
StatusFileSize
new10.22 KB
new144.8 KB
new71.39 KB
new133.39 KB
new126.15 KB

Here we are, this should be a fully working patch. I've attached some screenshots of how to set it up. Basically you create a view, then set "Quicktabs" to the display style. You can then use any field in your view as the tab title.

Some caveats:
- Does not support AJAX-tabs.
- You MUST use the fields display, not a Node type listing. Otherwise the Quicktabs display style doesn't know where to pull the title from.

Nevertheless it's a pretty good enhancement. With it you can make tabs of *anything*, such as tabs of comments using date-posted as titles, or tabs of ratings based on 1-5 stars. The options for making tabs here are as limitless as Views itself.

The patch is pretty modest, about 200 lines added. It also makes one small change to quicktabs.js, an $.unbind() call on the links before Quicktabs does it's normal link binding. This is because Views adds it own click binding to content during the live-preview. If we don't add this unbind first, then trigger the $.click() on the active tab manually, the Views preview gets stuck in an infinite loop of AJAX requests (it ain't pretty). I figure it's an acceptable change.

katbailey’s picture

Wow - looking forward to testing this out! Fyi I've been looking mostly at D7 Quicktabs lately and trying to figure out what direction to go with it, mainly in relation to this issue #553070: Merge with tabs module for D7?, more specifically the idea of switching it over to use jQuery UI Tabs seeing as that's in core in D7. In playing around with this I've changed the theming side of things to use a tpl file which it really should have been doing in D6. The way the spitting out of mark-up is so mixed up with the logic of building the tabs is shameful :-(

Anyway, I'll need to add consideration of this new feature in to my ruminations. Quicksketch/add1sun if you have any thoughts on the issue of switching to jQuery UI Tabs for the D7 version, given your work on this patch, I'd love to hear them!

quicksketch’s picture

Yeah regarding theming I had a bit of hard time figuring out what to do in this patch. I needed to simply include a DIV around grouped items, but because Quicktabs is based around the idea of building up a $tabs array and passing it into tabs_render(), it just didn't make any sense to use a .tpl.php file. Using a theme function with Views is a bit of a shaky concept, since Views is built around assumptions that you'll be using .tpl.php files.

It's great to know that the next version will be tpl.php file based, it makes a lot of sense. It might also make this patch use tpl.php files instead of a theme function. Merging with Tabs is also great, since I think my experience has been about 50/50 with clients using one project or the other. I'm sure there are differences between them feature-wise (I know how they're different API-wise), but from the end-user perspective it's, "I want 'tabs'" and they don't really care much beyond that.

That said, this patch would make an excellent starting point for any future version of the module since it gets all of the basics in place. Views for Drupal 7 is nearly API-identical to Drupal 6, so this could be ported with ease. Do you have any idea if this is feasible to include in the D6 version, or has Quicktabs already jumped the D6 ship? ;-)

add1sun’s picture

StatusFileSize
new10.22 KB

This is the same patch as #11, just with a typo fix in the theme hook (arguents > arguments).

katbailey’s picture

Version: 6.x-3.x-dev » 7.x-2.x-dev
Status: Needs review » Fixed

woohoo! committed - it took me two commits as I wasn't paying attention (did this while watching Crell's session on views for developers, specifically the bit about views style plugins :-P)
http://drupal.org/cvs?commit=357140
http://drupal.org/cvs?commit=357144

Thanks quicksketch and add1sun!

katbailey’s picture

Version: 7.x-2.x-dev » 6.x-2.x-dev

oops, changed it to the wrong version - I really should stop pretending I can multi-task. Now, back to Crell's session...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

katbailey’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Closed (fixed) » Patch (to be ported)
Anonymous’s picture

Hi all

should be nice to have on 7.x

Best Regards
ArchGalileu

JTxt’s picture

I loved this feature for a drupal 6 site.

Perhaps the project description should be changed until this is ported?

The 7.x-2.x provides the same functionality as 6.x-2.x, with the exception of the addition of ctools-based exportability and the views style plugin to display list of nodes as quicktabs..

Any ideas how to do this for d7?
(Perhaps I can add theme to add the quick-tabs classes to the the output? or figure out how to port this...)

Thanks!

katbailey’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev

I've added this to the 7.x-3.x branch, which will soon be taking over from the 2.x branch as the recommended version - will be rolling a beta in the next few days...

yareckon’s picture

sub... sounds delicious.

JTxt’s picture

Awesome, thanks katbailey!

I had an issue with it overriding my sort criteria in views, so I commented out line 220 in quicktabs_build_quicktabs
// array_multisort($weight, SORT_ASC, $contents);

Although that may break it for other uses? (Haven't found where yet.)

g76’s picture

sub

katbailey’s picture

Status: Patch (to be ported) » Fixed

This has been added to the 3.x branch and is included in the 3.0-alpha2 release, with a fix for #23.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.