It would be great if I could specify an arbitrary path as tab content and pull in whatever is returned from the callback for that path. An example use case would be embedding several panels inside of quicktabs so that they could be loaded asynchronously.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | quicktabcallback.patch | 1.04 KB | ronnbot |
Comments
Comment #1
pasqualleDo you mean ajax loading of any page on given path? My guess would be that will not work in the most cases, as many pages require additional js and css, which won't be loaded through the ajax call.. One example is the views page where it certainly does not work..
panels panes should be supported directly, if it is possible. It requires to much input data and it is quite complex: #236925: Panels 3 as tab content
Comment #2
katbailey commentedI've added this functionality in the 3.x branch - I need to write up documentation for it but basically you can choose "callback" as your tab type and then specifiy a path, e.g. my/callback/path. Then your menu callback function will do something like this:
What quicktabs_ajax_wrap() does is ensure that all js and css gets lazy loaded for the ajax content and returns an array that is correctly structured for the quicktabs ajax success function on the js side.
Please test :-)
Comment #3
ezra-g commentedAwesome - thanks!
I'm not actively using Quicktabs at the moment, but will definitely be back to test this (and encourage some folks on a project to use it instead of their custom solution ; ) .
Great stuff here.
Comment #4
ronnbot commentedHere's a patch that would not necessitate rewriting a menu callback for compatibility with quicktabs ajax functionality; therefore, allowing utilization of any existing menu callback.
Comment #5
katbailey commentedThanks Ronn - that's much nicer :-)
Committed.
Comment #7
laz0rama commentedhi, i am trying to use a callback for the quicktabs content, but i cannot figure out how. my problem might be that i am not all that familiar with menu callbacks.
i have a module, call it pacpar. i have created a callback function named "pacpar_qt_load_tab_0", whose intent should be clear. in the quicktabs admin, for that tab, what do i put in the "callback path" field for that tab? also, do i need to add something to my pacpar_menu() hook? if so, what exactly?
sorry for seeming such a newbie, i am only a newbie to the menu callback system.
thanks for any help!