by
KK » Tue Aug 30, 2016 1:44 pm
Hello,
the tutorial not offer how to convert the static form into the couch cms form !
The conversion has been described in detail in the 'Comments' section of the docs (
http://docs.couchcms.com/concepts/using-comments.html), so the tutorial actually points to that instead of rehashing the same info -
We could modify this form to make Couch fit into it. However, since a comments submission form is such a standard component of a blog, in this case we can save some time by reusing the submission form that is described in Couch documentation of comments.
Basically, the comment form is just like any other Couch managed form and you can use any markup for it - the only requisite is to use inputs with some
pre-defined names. Details from the referred docs -
Roughly speaking, a comment form needs to have three inputs (of type text) named k_author, k_email and k_link. These are used to input the commentator's name, his email and a link to his site. The form also needs to have a textarea named k_comment for inputting the actual comment.
Only the k_comment field is mandatory for Couch to save the comments. However, if needed, you can make any of the other fields mandatory too by setting their required parameter.
On successful submission of the form, the process_comment Couch tag can be invoked to process the submitted comment and save it into the database.
Hope it helps.