Here are some of the problems often encountered when creating or overloading a content type in CMS Ametys .
If you can't find the answer to your question, please feel free to consult our forum, in the settings and integration section.
Q.1 | What if I don't want articles to be commentable by default? |
---|---|
R. |
You need to override the article content type, redefine the "comment" attribute and set its default value to false. |
Q.2 | How can I make comments mandatory on my type of content? I don't want a contributor to be able to decide that a piece of content can't be commented on. |
---|---|
R. |
Override the content type if it already exists, and redefine the "comment" attribute with a default value of true. <cms:metadata name="comment" type="boolean"> <label i18n="true">CONTENT_NEWS_COMMENT</label> <description i18n="true">CONTENT_NEWS_COMMENT_DESC</description> <cms:default-value>true</cms:default-value> </cms:metadata> Then, in the editing view of this type of content, don't specify the "how" attribute, so the checkbox won't appear. <cms:metadata-set name="main" type="edition"> <cms:metadata-ref name="title" /> <cms:metadata-ref name="document-subtitle" /> <cms:metadata-ref name="illustration"> <cms:metadata-ref name="image" /> <cms:metadata-ref name="alt-text" /> </cms:metadata-ref> <cms:metadata-ref name="abstract" /> <cms:metadata-ref name="content" /> <!--cms:metadata-ref name="comment" /--> </cms:metadata-set> |