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 %}
craft.comments.all
supports the following parameters:
Parameter | Description |
---|---|
elementId | |
elementType | |
userId | |
status | |
name | |
email | |
url | |
ipAddress | |
userAgent | |
comment | |
order |