fm:CommentList
Component description. Use paragraphs, punctuation and full sentences. Avoid bulletpoints.
Example
<!-- Primary code example. This example should display the simplest use-case possible. -->
Supported attributes
| Name | Required | Default | Description |
|---|---|---|---|
| dateFormat | Optional | %Y-%m-%d %H:%i:%s | This allows you to specify how the 'time' template variable is displayed. |
| evenClass | Optional | The contents of this attribute will be placed in the 'loop.evenClass' template variable, only for even row-numbers. This allows you to give every even row a specific css class | |
| maxChars | Optional | N/A | If this attribute is supplied, a comment_shortComment template variable will be available. This variable will have as much characters as specified here. |
| mid | Optional | N/A | Specify the mid to only show comments on a specific media-item |
| moderationStatus | Optional | N/A | This allows you to override the vhost's moderationstatus. Use 0 for unapproved files, 1 for accepted files, 2 for denied files. Leave this empty for everything. |
| oddClass | Optional | The contents of this attribute will be placed in the 'loop.oddClass' template variable, only for odd row-numbers. This allows you to give every odd row a specific css class | |
| pageSize | Optional | 50 | Limit the number of comments per page by this number |
| sort | Optional | time ASC | By using the sort attribute you can order the commentlist on a specific field, for example time DESC |
| startPage | Optional | 0 | The current page in the comment list. The offset is determined by multiplying the pageSize with the startPage. The first page is page 0. |
| uid | Optional | N/A | Specify the uid to only show comments from a specific user |
Deprecated Attributes
Optional notes about the supported attributes.
Template variables
| Name | Description |
|---|---|
| loop.hasResults | The contents of this variable will be either 0 or 1, depending on if there are items in the list. |
| loop.oddClass | The contents of this variable will reflect the "oddClass" attribute. This will only be set for odd rownumbers. |
| loop.evenClass | The contents of this variable will reflect the "evenClass" attribute. This will only be set for even rownumbers. |
| loop.index | The 0-based index of the item in the loop. (Will contain 0,1,2,3,4, etc.) |
| loop.currentPage | If a pager is involved in this loop, this will contain the current page number (0-based index). If page information is not available, this will be 0. |
| loop.currentPage1 | This value is currentPage + 1. This number can be useful to display the current page number to use user. (people generally count from 1, not 0). |
| loop.totalPages | Total number of pages avaiable in this loop. This will be 0 if the loop does not support paging. |
| loop.totalItems | Total number of individual items. This will be 0 if the loop does not support paging. |
| loop.pageSize | Total number of items on 1 single page. This will be 0 if the loop does not support paging. |
| comment_comment | The actual comment. |
| comment_id | The unique id for this comment. |
| comment_mid | The mediaitem for which this was a comment to. |
| comment_offset | The offset of the comment in the requested list. |
| comment_owner_id | The user-id from the person who owns the commented file. |
| comment_owner_name | The username from the person who owns the commented file. |
| comment_poster_name | The username of the person making the comment. |
| comment_time | The time the comment was made. |
| comment_uid | The user-id from the person who made the comment. |
Optional notes about supported template variables.
See also
- List of related pages in the documentation here.
More examples
<!-- Complex code examples. Note that the goal is not to write an entire application here,
instead it should focus on advanced usage patterns of the component. This section is optional-->
developer documentation r17362