aroc / side-comments

[UNMAINTAINED] An interface component to give your site/app Medium.com style commenting.

Home Page:http://aroc.github.io/side-comments-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to specify form markup

richardtape opened this issue · comments

Hi there,

In order to be able to fully integrate this within WordPress (or any other platform which provides native comment forms) it'd be great to have the ability to say "Hey, this is my comment form textarea. It has an ID of #comment-form (for example). Use that."

This way, I can use the native WP Comment Form (and all of the hooks that it provides) so any plugins which tie into that form should just work.

What do you think?

I don't think it's a necessarily a bad idea, but I'd prefer not to make changes to the project to support a single platform and I don't see this being particularly useful in other scenarios. With WordPress, are there problems hooking into the events that get fired from SideComments then making an ajax request to the backend to save the comment? Are the WP hooks not fired if it's done this way?

If there's an issue with that, you may also be able to hook into the event and and copy over the values then trigger submission of the form.

Otherwise, if the project does go this route, we'd need to talk through a little more how this feature would work. For example, if you provide an ID for an alternative textarea of form, does SideComments copy that node over to the right spot on initialization?

I'm not sure I explained myself properly. I'm saying don't embed the form yourself. Allow someone else to specify the markup for the form itself. Does that make more sense? As you've seen I've got your js working as a WP plugin, but as it's an entirely JS solution, there's no way to use WP's native comment form markup (and hence all of the hooks that get used)

Ah okay, I see what you're saying. To help give me a better idea of what the differences are, can you post an example of the form markup you might use and what the differences might be that you need? I'm just trying to get an idea of how this might fit into the project.