Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I downloaded and installed modal_forms for my site. When I read the documentation. It wrote:
- Comment (modal_forms/%ctools_js/comment/reply/%node)
- Comment (modal_forms/nojs/modal_forms/nojs/comment/reply/[nid])
I tried both of them but I can't run comment in a modal form. It returned an AJAX HTTP. After study, I change code like that:
print $links[] = ctools_modal_text_button(t('Comment'), '/comment/reply/'.$node->nid, t('Login via modal'), 'ctools-modal-modal-popup-medium');
It run correctly :)
Comments
Comment #1
frjo CreditAttribution: frjo commentedThanks for catching the bad documentation, I have updated the README and the project page now.
This I believe is the correct way to generate a link for the comment form.
Comment #2
imoreno CreditAttribution: imoreno commentedHi,
Im using this code via node panel, implemented as a php code, and it produced an AJAX error.
What needs to be done in order to implement this code on a node panel page?
Comment #3
frjo CreditAttribution: frjo commentedA link to a page with this error?
Comment #4
imoreno CreditAttribution: imoreno commentedHi,
while site doesn't accept anonymous comments, this is the ajax respond (in Hebrew....)
basically it is a page not found error with all the page source code...
I hope this helps somehow to understand the problem.
Itzhak
Comment #5
imoreno CreditAttribution: imoreno commentedHi,
I suspect this is due to the use of node panels, so the link doesn't get the apropiate nid parameter.
How do i change this code:
print $links[] = ctools_modal_text_button(t('Comment'), 'modal_forms/nojs/comment/reply/' . $node->nid, t('Comment via modal'), 'ctools-modal-modal-popup-medium');
In order to support node panels and pass to the modal window the correct URL that's include the correct nid of that pannel?
BR
Itzhak