what could be inside ajax quicktabs

Pasqualle - December 10, 2008 - 11:46
Project:Quick Tabs
Version:6.x-2.x-dev
Component:Documentation
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

People start putting more stuff inside tabpages without realizing the limit of possibilities.

If the QT is a non ajax QT then you can throw mostly anything into it.
You can create a block, which is a panel, which contains ten nodes and some views. You can create a node which contains three views. You can use these stuff without problem inside non ajax QTs, because they are all loaded at page load, quicktabs does not interfere with their rendering, it just simply hides some of it when someone clicks on the tab.

So what could be insibe ajax QT?
Simple rule is: you can put anything inside ajax QT unless it does not require additional javascript or css files.

The confusing thing is that there is one exception: you can put ajax view inside ajax QT, but that is only because it got special care from the quicktabs module. That means if you select view as a tab type then it should work. You can use views pagination and filtering, even you put it into ajax QT. But you can't use a block or node which contains the ajax view, because that won't work. The view must be directly under the tabpage.
So if you can't select the ajax view directly as a tab then you must turn off ajax rendering for the QT.

It is not enough? You really need to put more ajax stuff inside ajax QT. I don't know. I did not tried pushing these limits. But you may experiment and report back what worked for you. I know there is a thing in views, called attachment display which could display additional view inside view, but I must tell I never tried that with QT.

So if you know other secrets about how special ajax things can be inserted into ajax QT, then you can share it here.

#1

Pasqualle - December 10, 2008 - 12:33

first tip: how to fix the style of QT which is inside ajax QT?

you need to load the additional style manually at page load
you can simply do that for example inside an additional block (if you are allowed to use php there):

<?php
  quicktabs_add_css
('Sky');
?>

replace Sky with the required style, make the style name first letter upper case
but wait for tomorrow because of this: http://drupal.org/cvs?commit=158058

#2

panji - December 11, 2008 - 05:33

Can we use Ajax Load module for this condition? it would be great... for more flexible content in QT
http://drupal.org/project/ajax_load is a helper module to load and add JavasScript and CSS data for Ajax-loaded content.

#3

expatme - December 11, 2008 - 17:19

how do i load nodes and cck fields?

#4

panji - December 12, 2008 - 23:42

@expatme u can use Views

#5

Flying Drupalist - December 25, 2008 - 17:19

I have some js in my script.js which goes at document.ready. Of course none of it works for anything inside ajax QT.

Is there a way to write my script so that it applies to the tab, or perhaps for QT to load my script.js on tab load?

Ajax load is interesting, but not a clue how to use it. I think it would have to be implemented inside QT?

#6

Minqensan - December 30, 2008 - 17:55

I think some of this is possible with the livequery plugin. Going to test it out now.

#7

katbailey - December 30, 2008 - 18:41

@Miraploy, @Minqensan - the main question here is whether your scripts are being loaded and it's just a case of the behaviours not being attached to the content inside the QT or are the scripts not even being loaded to the page? If it's just a question of the behaviours not being attached, we can fix this by running Drupal.attachBehaviors on the ajax-loaded content (no need for the livequery plugin). Otherwise Ajax Load is probably the way to go. If I could get an example of a particular use case and figure out which of these two scenarios best describes the nature of the problem then I'll know which direction to take to find a solution.

#8

Flying Drupalist - December 30, 2008 - 20:40

Hi, thanks.

There's some custom code that I put into my script.js that I want to apply to ajax blocks.

Here's an example:

$('ul.activity-list li').css('cursor','pointer').click(
function () {
document.location=$(this).find('a.click-here').attr('href');
}
);

This sets click on li = click on some inside link.

This is probably a case where I want to use Drupal.attachBehaviors.

I also want to put a tribune block inside ajax QT.
http://drupal.org/project/tribune

That's probably a case where the js isn't even loaded. *though i'm not entirely sure. I use JS aggregation, and does it simply stuff everything into one file? Or create multiple variants of the file?

Thank you for your help.

#9

Flying Drupalist - January 7, 2009 - 00:36

Well livejquery was very helpful in getting all my custom code to work inside ajax tabs. However I have no idea how to apply it to blocks created by modules. Any thoughts?

#10

Flying Drupalist - January 17, 2009 - 14:25

Live is now in jquery 1.3 which is exciting.

Another thing I found was this:
http://groups.drupal.org/node/18189

Maybe some of what popups was doing can be implemented in QT for full ajax support of everything? :D That would be exciting.

#11

katbailey - January 17, 2009 - 21:23

@Miraploy thanks for posting that link - this is exactly what Quicktabs needs to be keeping up with if we want to reach a stage where all content with its own ajax functionality, and not just Views, works well in a quicktab. However, there is as yet no generalised solution and there's no point in duplicating code from popups module, which in turn is apparently very similar to what's being done in ajax_load module. What I'm saying is, I'm not going to spend time on a custom solution for Quicktabs (though if someone else wants to submit a patch please feel free ;-)) when it seems that time would be better spent helping achieve the more generic solution that could first of all become a standard API module (ugh - a dependency, but maybe not for long) and eventually make it into core.

#12

Pasqualle - January 17, 2009 - 22:54

#251578: More flexible js/css ordering and an alter operation
Is this the issue we are looking for, or we need more than that?

#13

Flying Drupalist - January 18, 2009 - 00:46

Thanks for letting me know.

So I guess we're not going to see this very soon are we?

 
 

Drupal is a registered trademark of Dries Buytaert.