Comment
This is a representation of single comment associated with article. Most usually, there is a array of comments with article.
Availability of comments
Comments can be accessed through article by using {{ article.comments }} variable. This accessor method returns only comments that are in public state (e.g. not spam). Here is an simple example:
{% for comment in article.comments %}
From: {{ comment.author }} at {{ comment.created_at | date:"%d.%m" }}
{{ comment.body }}
{% endfor %}
Available properties
These properties give access to extra features on this object.
author
Returns author name for comment.
body
Returns formatted body for comment.
created_at
Returns Time object representing comment create time.
- Basics
- Variables
- Filters
- Components
- Localization
- Keyboard shortcuts
- Objects
- Article
- Asset
- Blog
- Comment
- Element
- Language
- Mediaset
- Menu item
- Page
- Person
- Site
- Tag
- Data
- Tags
- addbutton
- assign
- blogcontext
- case
- capture
- commentform
- content
- contentblock
- cycle
- editable
- elementscontext
- for
- grouped
- if
- ifchanged
- image
- include
- load
- login
- loginblock
- menuadd
- menubtn
- menulink
- reorder
- rss_link
- stylesheet_link
- unless
- xcontent
- Examples
- Creating a navigation menu
- Creating language selection
- Blog page example
- Blog article example
- Complete page example
- Breadcrumbs
- Standard theme definition
- Elements listing
- Element page
- Components