Blog Article Comment Form¶
The <blog-article-comment-form>
webcomponent is used to render a form handler for blog comments.
Usage requires adding an HTML elements with slot="form"
attribute in which form elements such as inputs and buttons should be provided. It is used in blog_article_comments_modal_form macro.
Attributes¶
Attribute name | Type | Default | Description |
---|---|---|---|
module-instance-id |
number | null | A unique instance id of the instance of the module the webcomponent is used in. It is needed in case there are multiple blog comment forms |
article-id |
number | null | An id of the viewed article |
DOM events¶
This webcomponent listens to the following DOM events:
Example¶
<blog-article-comment-form article-id="88" module-instance-id="1">
<form-connector id="blog-comment-form-connector-1" submit-strategy="frontApi">
<form id="blog-comment-form-1" action="/webapi/front/pl_PL/news/88/comments" method="post">
<input type="text" placeholder="name" />
<input type="text" placeholder="comment" />
<button>Add comment</button>
</form>
</form-connector>
</blog-article-comment-form>