Doesnt work when multiple commentforms on one page…
-
Hi Dom,
Can you send me a direct link to an outfit? I’m in the process of updating this plugin, I have the following coming: https://github.com/zanematthew/inline-ajax-comments/issues?state=closed
Hi guys,
I think that this could be fixed better with just naming the #comment id uniquely, easiest way is to make it uniform with the post.
So if it is a comment on post ID 43, then you could have #comment_43 be the selector instead of comment.
This can easily be done:
<div id="comment_<?php Print get_the_ID ?>"Forgot that get_the_ID returns an INT and we want a STRING..
anyway, it could be done similar to this:
<!-- Get the post id the comment belongs to and change it from int to string "comment_POSTID" --> <?php $cp_id = get_the_ID();?> <?php $comment_post_id = "comment_" . strval($cp_id); ?> <!-- The comments container is now unique --> <div class="inline-comments-container" name="<?php echo comment_post_id ?>">I’m also working on this:
https://github.com/MattMcFarland/inline-ajax-commentsThe problem is that the target needs a unique identifier, I’ll show a fix here shortly.
Matt,
Adding it a unique ID makes sense, in your current master branch here, https://github.com/MattMcFarland/inline-ajax-comments/blob/master/templates/comments.php#L26 your adding it to the class. It would be be better to do it as you have above, since the class “inline-comments-container” shouldn’t be unique.
Hi zane, I agree.
Please see my latest update on github (dev branch) I’m using id instead of class to keep stylesheet intact.
Also, you can’t use document.submit for multiple posts working
So far I have multiple comment postings reading perfectly fine now and the more / less buttons also work according to plan.
Now to rework the the ajax submit and it’ll be 100% finished.
you can see it working (except ajax submit) on http://www.hvac-hacks.com
Ok.. So I now have it working (sorta) So far put about 8 hours into this heh.
Problem 1: comments ajax handle, ‘data-template’ is now returning undefined.
Problem 2: Had to disable wp noonce in template-tags to get it to work.
Can’t seem to find a fix for these issues can you help? It’s almost 100% done!
Please look at my github dev branch, the latest (with problems) is there:
https://github.com/MattMcFarland/inline-ajax-comments/compare/dev?expand=1I have it fully working
My changes are below:
= 1.2.4.5m =
* Fix: unique target id’s added
* Fix: ajax loading multiple comment lists
* Fix: ajax submit multiple comment lists
* Fix: more/less buttons work on multiple comment lists
* Enhanced: swapped more/less buttons with graphics
* Tweak: More/Less stays on the same line as the input box at smallest browser widths for responsivenessTODO: implement multi-listing wp_nonce functionality.
= 1.2.4.3m =
* Fix: Allow for use ANYWHERE= 1.2.4.2m =
* Fix: Changed “user_nicename” (deprecated) to “display_name”= 1.2.4m =
* Tweak: Changed min-height from 17 to 32You can download it here:
https://github.com/MattMcFarland/inline-ajax-commentsMatt,
Thanks for contributing! exciting, I pulled your test branch down, and making a few commits on it. I do all my dev on the dev branch, and only push to master when I’m ready to update the repo on .org
I just merged the branches and ran into some issues, currently cleaning them up and hope to have my dev branch updated soon.
Also cool to see it working on your site!
The topic ‘Doesnt work when multiple commentforms on one page…’ is closed to new replies.
(@domdom2013)
12 years, 11 months ago
Hey,
great plugin. Just one problem: I use it more than once on a page, and it doesnt work there…
Go to http://www.outfitya.com/de/, create 3 or more test outfits and then go to “meine outfitfits”. U see then the comments load everywhere. just when submitting the a comment on the second or third comment field, it doesn’t load the newest comment into the correct spot…
I think it has to do with this code:
“target_div”: “#inline_comments_ajax_target”, exists more than once on my page… So thats why it cannot append the new comment correctly.
Maybe something like
“target_div”: $(this).closest().”#inline_comments_ajax_target”, would work…
Would love see it working for multiple comment section on one page…
Greets,
Dom
http://ww.wp.xz.cn/extend/plugins/inline-ajax-comments/