Hi there,
I wondering, how to add a query "?blal=bskals! to a ctools modal button?

If I use this I get problems with special characters..

...
$path = 'ctools_modal01/node/';
  $path .= $row->nid;
  $path .= ('?name=' .$name);

ctools_modal_text_button(t('button'), $path, t(button') );

Any hints

Comments

yurtboy’s picture

any luck on this?

jordanmagnuson’s picture

Version: 6.x-1.8 » 7.x-1.x-dev

I'm wondering about this as well (latest D7 dev). Specifically, I want to be able to set the query to drupal_get_destination() , to redirect users after filling out the form, if they do not have js enabled.

Otherwise, as far as I can tell, there's no way to redirect non-js users back to their original location after filling out a modal form...

nagiek’s picture

Chiming in to say I don't know either, lol.

I was also looking to use drupal_get_destination(), but no luck.

nagiek’s picture

Status: Active » Closed (duplicate)

Just thinking about this a little more. @JordanMagnuson, you and I want to get the original destination, whereas the original poster wants to pass a variable to a modal (I think).

Marking this as a duplicate of #1039858: Additional configuration option for String arguments to pass URL query string to contexts and opening an issue for getting the original destination.

abhaysaraf’s picture

Issue summary: View changes

You can provide query parameters using below code.

<?php
$text = 'Delete';
$dest = 'popup/nojs/node/1/delete';
$alt = 'Delete';
$class = 'ctools-modal-concept-multistep-style'; //custom modal style
$type  = 'ctools-use-modal';

drupal_add_library('system', 'drupal.ajax');
print l($text, $dest, array('html' => TRUE, 'query' => array('destination' => 'template-list'), 'attributes' => array('class' => array($type, $class), 'title' => $alt)));
?>