Is there a way to add custom fields to content comments?
For example, I would like to add a date input field and a subject field.
Alternatively could this be accomplished with the Solspace plugin "Freeform Pro 4.0.8"?
ExpressionEngine® Answers is a question and answer site for administrators, end users, developers and designers for ExpressionEngine® CMS. It only takes a minute to sign up.
Sign up to join this communityIs there a way to add custom fields to content comments?
For example, I would like to add a date input field and a subject field.
Alternatively could this be accomplished with the Solspace plugin "Freeform Pro 4.0.8"?
There is no native way to add additional fields to the EE Comment module, no.
Freeform could work. You would have to have a hidden field that stored the entry_id
of the entry being commented on, so that you could then use search:comment_entry_id="{entry_id}"
when listing the comments with the Freeform Entries tag.
(Note that you'd likely have to either embed your "comments" Freeform Entries loop and pass the entry_id
via an embed variable, or grab the entry_id
from the URL - {segment_3}
for example - in order to avoid variable collisions with the Channel Entries tag.)
comment_entry_id
(or whatever you call your field) which matched the value of the $entry_id
passed by the hook.
Dec 6, 2012 at 19:38
I would say the easiest thing to do would be to repurpose use of one of the existing fields, unless you are already using all of them. Comments can capture: name, email, url, location, and comment. I'm excluding creation and edit dates, as well as entry_id, ip_address, etc.
For example, if you are not using 'location' then use it and re-label it 'subject'.
Of course a number of sites, bypass EE's built in commenting system and use Disqus or Facebook.
I would check out the Rating Module which offers "custom fields" for comments/reviews.
Edited to note: There is also DevDemon's Channel Ratings which might also be worth looking into.
Each one offers different capabilities and one might fit your needs better than the other.
I'd go with a custom extension. Here's the hooks you'll need:
I've developed an add-on called Custom Comment Fields that allows custom fields to be submitted with comments (handles text inputs, textares and attachments via Safecracker File field). Datepicker not supported yet, but is in plans.