Active
Project:
Popups API (Ajax Dialogs) [D7]
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 May 2009 at 08:58 UTC
Updated:
26 Mar 2011 at 07:57 UTC
Adding class="popups-form" to the 'Add New Comment' link is easy. The problem is that it doesn't return just the form - it returns the item parents as well which is ugly and unnecessary. I'm assuming all that is needed to be done is to create a page that returns just the right comment form which seems pretty easy. Before I attack the comment module I thought I would check to see if anyone has done it already or perhaps an easier solution.
Thanks
Awesome module by the way..
Comments
Comment #1
mstef commentedComment #2
vertazzar commentedthanks for info, im going to use that override as well.
Comment #3
mstef commentedNo problem - just don't forget to select the comments links
'node/*' = array(
'a[href^=/comment/]',
),
Also, make sure you empty out the entire cache. Had some problems with the alter hooks.
Comment #5
Oghnia commentedI seriously don't get what was done here, can someone please elaborate :)
thanks
Comment #6
Oghnia commentedsorry forgot to open it
Comment #7
mstef commented@Oghnia
If you want to enable popup comments, create a helper module and include the two functions from comment #1. then add the code in #3 to the modules hook_popups.
Comment #8
v8powerage commentedin popups_comment.module:
in popups_comment.info:
Put those two files into folder named
popups_commentin modules directory, go toadmin/build/modulesenable, then go to/admin/settings/performanceand clear cache.Comment #9
sirkitree commented@see #508830: Duplicate attachment of Wysiwyg behavior with Popups for the problem with editors like tinymce or bueditor.
Comment #10
darsic commentedHow can i add popup class to
print $links;?Comment #11
obrienmd commentedI must be a fool - I still don't understand. It's easy for me to put the functions from #1 into a custom module, but I'm not sure what is meant by "then add the code in #3 to the modules hook_popups."
Is anyone willing to spell that last part out a little more extensively?
Comment #12
v8powerage commentedI pasted code at #8. Just create file in text editor and save it as module.
Comment #13
obrienmd commentedWorks great, thanks so much!
Comment #14
RedTop commentedUnfortunately the module in #8 doesn't work for me. After adding the popups_comment module I get a syntax error:
Tried adding an extra ")" and this "solves" the syntax error, but no popups for me after clicking "add new comment". Obviously I am no PHP coder... :P
I am using a WYSIWYG client side editor (FCKeditor).
Comment #15
v8powerage commentedSorry, my fault missed one
),now it's ok.Comment #16
obrienmd commentedHrm - I spoke too soon... I've added the modules as instructed in #8, but hitting a comment link in a node does not bring up a popup, just opens up a new page w/ comment form on the bottom. The link seems to satisfy the requirements (in the "links" area), any ideas on debugging?
I see "('. t('Edit') .')" in your function, but not really sure what this means? I don't see "Edit" anywhere in the tag or text of my comment links...
Comment #17
obrienmd commentedI am an idiot - it was looking for the string "Edit", I just changed to something else that was in the link's text, and it worked great. Thanks!
Comment #18
RedTop commentedCould you please elaborate obrienmd? I now have:
(replaced Edit with comment), but that doesn't do it for me.
Comment #19
v8powerage commentedThe code was for editing comment, to add reply feature, replace 'Edit' with 'Reply'.
Comment #20
RedTop commentedThanks, I had tried that before but was under the impression it didn't work. Now I know why: it only works for comment links on the actual node itself, not the links below the teaser (as would be the case with blogentries on the frontpage).
I am going to tinker with it a little more. See if this may be a good opportunity to learn PHP. :P
Comment #21
v8powerage commentedRedTop - for the comment reply link which is in other place, than node try this:
Comment #22
RedTop commentedThanks, works like a charm. :)
Comment #23
RedTop commentedStep-by-step:
In your sites/YOURSITE/modules directory create a folder 'popups_comment'. In this folder create two files with the code pasted below:
file: popups_comment.module
file: popups_comment.info
Enable the new module and clear your cache using administer > site configuration > performance
Thanks to Shaman for the code. :)
Comment #24
RedTop commentedI'm busy developing a module to add popup support to comment forms. It is a first attempt at Drupal Development and a bit of PHP. This is what I have so far:
popups_comment.module
popups_comment.info
popups_comment.admin.inc
It works, but there are some glitches that I would like to fix but don't know how:
1) After enabling or disabling the functionality at the popups admin settings page one has to manually clear the cache and rebuild the menus before the changes can be noticed. How can I prevent this?
2) popups.admin.inc for now repeats the admin settings form code from popups.module. Is there a way I can simply call the form as defines in popups.module? This prevents having to update popups_comment.admin.inc everytime the popups settings page is changed.
3) When previewing a comment the parent node/comment is shown below the form. I would like to remove this. How do I do that? I assume I have to use hook_menu_alter.
Comment #25
RedTop commentedchanged status.
Comment #26
Caderial commentedI have implemented this module for comment pop up, but when ever i submit the comment, the page reloads within the popup opposed to closing the pop up and reloading the page beneath.
How can i force the Pop up to close & reload the page with the new comments when i click the save (submit) button in the comment form pop up?
when i submit comments normally from a users blog page(without pop up), it takes me to the node of the specific blog post instead of back to the blog page i have created in views. I need to redirect the user back to the Blog page not the node of the post they commented on. I think this might be why the PopUp comments is keeping the pop up window open and loading the Node with its comments in it. Is there some code i can put into the popups_comment.module that will redirect the user back to the blog page and not he specific posts node?
Stranger still If the Post already has comments on it, and i Use the "reply" button under an existing comment, the pop up form comes ups fine, i fill in the comment reply, and submit. now it does its loading thing and closes the pop up and reloads the page below it fine. This is the functionality i want on the Add a comment form pop up as well.
Its strange that they act differently, seeing as how they are both pulling up the same form in the pop up...
Fairly new to this so any help would be appreciated.
My popups_comment.module
My popups_comment.info
Comment #27
Caderial commentedmaybe implement a .forceReturn ??
Comment #28
ruinze commentedsubscribed