I downloaded and installed modal_forms for my site. When I read the documentation. It wrote:

  1. Comment (modal_forms/%ctools_js/comment/reply/%node)
  2. 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 :)

CommentFileSizeAuthor
#4 modal.png22.74 KBimoreno
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

frjo’s picture

Thanks 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.

ctools_modal_text_button(t('Comment'), 'modal_forms/nojs/comment/reply/' . $node->nid, t('Comment via modal'), 'ctools-modal-modal-popup-medium');
imoreno’s picture

Hi,
Im using this code via node panel, implemented as a php code, and it produced an AJAX error.

print $links[] = ctools_modal_text_button(t('Comment'), 'modal_forms/nojs/comment/reply/' . $node->nid, t('Comment via modal'), 'ctools-modal-modal-popup-medium');

What needs to be done in order to implement this code on a node panel page?

frjo’s picture

A link to a page with this error?

imoreno’s picture

FileSize
22.74 KB

Hi,
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

imoreno’s picture

Hi,
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

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.