Comment Element#

You can access comments from your templates via craft.comments.all which returns an ElementCriteriaModel (opens new window) object.

{% set comments = craft.comments.all({
    userId: currentUser.id,
    limit: 10,
    status: 'pending'
}) %}

{% for comment in comments %}
    {{ comment.comment }}
{% endfor %}

Parameters#

craft.comments.all supports the following parameters:

ParameterDescription
elementId
elementType
userId
status
name
email
url
ipAddress
userAgent
comment
order

Previous ← Example CSS JS Next Comment Model →