Closed (fixed)
Project:
Chaos Tool Suite (ctools)
Version:
6.x-1.8
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 May 2011 at 02:42 UTC
Updated:
5 Jun 2011 at 20:41 UTC
Hi, I am implementing ctools with modal forms, very similar to the example module.
Simplifying things, I create my form and render it:
$output = ctools_modal_form_wrapper($form_id, $form_state);
ctools_ajax_render($output);
Then I render that in the page:
ctools_modal_text_button(t('Change'), 'my/callback', t('Frequency'), 'ctools-modal-frequency');
This all works properly and renders my form in the modal. However, my form is a multi page form. It's rendering the pager properly, but when clicking on the pager links it bombs out to a white page with only the JS on it. The pager links look like this:
http://mysite.com/my/callback?page=1&js=1&ctools_ajax=1
How do I handle paged content in the modal? I checked throughout the forum and didn't see anything like this so here I am. Any help you can provide would be appreciated. Thanks!
Comments
Comment #1
rjbrown99 commentedAlso, I do have ajax enabled in the form state.
Comment #2
merlinofchaos commentedIn order to have links in a modal function, you'll need to bind them to the proper URL and add the 'ctools-use-ajax' class to them.
Comment #3
msumme commentedHey, have you figured this out yet? i'm working on the same problem, and I can't seem to get it. I've added the class by overriding the theme function, but I can't seem to get the ctools in-place ajax link working. Would overriding all the theme functions be necessary? Then using ctools_ajax_text_button to render each kind of pager link?
Comment #4
msumme commentedThis was really really complicated, but it's possible...
I would love to see an elegant solution
Comment #5
rjbrown99 commentedHave not tried to fix it yet. I'm going to see about binding the ctools-use-ajax class to the pager links. I'm assuming that's all I need to do. Haven't thought about the best approach for that yet.
Comment #6
msumme commentedseems like you have to just theme the pager... in whatever way.
the other problem is that if it's in a multi-step modal form, the path for the links will be wrong, i.e. for the page you just came from, rather than the page you're landing on. So you will have to also make sure to have a way to override that.
It wasn't pretty, but it can be done... Although I could just be ignorant of something that would have made it all a breeze...