first of all, fantastic work on this module... it has really helped save real-estate on my site! :)
my question: why am i seeing "views/ajax" when manually displaying $_GET['q'] on one my tabs?
my problem: im attempting to pull in values from the URL inside one of the tabs, but when trying to break out the arg values, im getting the content mentioned above.
$aliaspath = drupal_get_path_alias(arg(0).'/'.arg(1));
$aliaspath = explode('/', $aliaspath );
when im on a page like mysite/users/steve, i would normally be able to call the code above, and get values of:
$aliaspath[0] => user
$aliaspath[1] => 5
but instead im getting the views/ajax values... i looked at this recent issue http://drupal.org/node/358137 but wasnt sure if applying some of the suggested patches would address my situation...
any thoughts?
Comments
Comment #1
steveadamo commentedi suppose i should provide some more detail, and clarifiy one thing... im using the "load only the first tab on page view" option...
if i supply an argument of %1, my tabbed content displays just fine... the problem comes when i try to manually insert a footer link...
in one case, i have a "my friends" tab... the view displays the users friends correctly, but in the footer, i have a "view all" link that would programatically build:
so, the link for me would be users/steve/friends, with "steve" coming from the URL... however, i get a link of users/ajax/friends...
simplified question: how can i pull the URL values into an AJAX loaded tab?
Comment #2
steveadamo commentedanother followup comment... i've tried applying the suggesions found here: http://drupal.org/node/332895
and can display the tabs, with the footer content like ive described (users/steve/friends, etc.), however... clicking on the tabs causes full page load... it looks like im getting some sort of ajax error:
Comment #3
steveadamo commentedone last comment... :)
if i change swap this one line in quicktabs.js:
i get the tabbed content to load with the args i want, but again, i get a full page load on each tab click... :(
Comment #4
pasqualleso you have an ajax view where in the footer you try to use this code
yes, that code will return {'views', 'ajax'} array. It has nothing to do with quicktabs, as ajax views are created on the views/ajax path..
If you do not have filter, sort or pagination in the view then set the view to non ajax, set the quicktab to non ajax, and your code should work as you expected.
the view footer will not know the url if the view is loaded through ajax..
Comment #5
pasqualle-
Comment #6
steveadamo commentedUnderstood, and thanks for the response... however, i have one related question...
if the AJAX quicktab is able to build the embedded view correctly, it is passed the appropriate paramaters (%1)... is there any way i can get at that value in my .tpl.php pages?
so, in my "friends" example, the quicktab is passed a value of %1... presumably the value of "steve" from the URL users/steve?
can i somehow get the %1 value to use elsewhere?
Comment #7
steveadamo commented**SOLVED**
for my specific scenario, i solved this problem by tweaking the ajax_path param in quicktabs.module:
now i can simply grab arg(2) from within the view... arg(0) = views, arg(1) = ajax, arg(2) = dynamic value
Comment #8
pasquallehmm, that does not seem good to me. with that modification an ajax quicktab should not be able to display a view. strange..
Comment #9
steveadamo commentedwell, it works in my situation, but if this introduces a security risk, or is in some other way too kludgey, please let me know... :)
Comment #10
WorldFallz commentedI ran into this as well-- not using an ajax view but using an ajax quicktab. Not using an ajax quicktab was not an option (as the whole point of using these views in quicktabs was to get the ajax).
However, you don't have to hack quicktabs, you also have access to the arguments for the view in view templates via $variables['view']->args (which is an array of arguments the view is using).
Comment #11
jienckebd commentedI needed to use arguments from the path inside of a block called in an ajax quicktab. I wrote a small function that uses the referrer (in this case, the page that's making the Ajax call) and breaks it out in to values that I use in my block. I know it's probably not a good solution but I couldn't find anything else out there.
In my blocks, rather than using arg(), I call mymodule_qt_arg().
Comment #12
netw3rker commented