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

NameRequiredDefaultDescription
dateFormatOptional%Y-%m-%d %H:%i:%sThis allows you to specify how the 'time' template variable is displayed.
evenClassOptionalThe 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
maxCharsOptionalN/AIf this attribute is supplied, a comment_shortComment template variable will be available. This variable will have as much characters as specified here.
midOptionalN/ASpecify the mid to only show comments on a specific media-item
moderationStatusOptionalN/AThis 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.
oddClassOptionalThe 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
pageSizeOptional50Limit the number of comments per page by this number
sortOptionaltime ASCBy using the sort attribute you can order the commentlist on a specific field, for example time DESC
startPageOptional0The current page in the comment list. The offset is determined by multiplying the pageSize with the startPage. The first page is page 0.
uidOptionalN/ASpecify the uid to only show comments from a specific user

Deprecated Attributes

Optional notes about the supported attributes.

Template variables

NameDescription
loop.hasResultsThe contents of this variable will be either 0 or 1, depending on if there are items in the list.
loop.oddClassThe contents of this variable will reflect the "oddClass" attribute. This will only be set for odd rownumbers.
loop.evenClassThe contents of this variable will reflect the "evenClass" attribute. This will only be set for even rownumbers.
loop.indexThe 0-based index of the item in the loop. (Will contain 0,1,2,3,4, etc.)
loop.countThe count of the current item in the loop. (Will contain 1,2,3,4,5 etc.)
loop.currentPageIf 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.currentPage1This 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.totalPagesTotal number of pages avaiable in this loop. This will be 0 if the loop does not support paging.
loop.totalItemsTotal number of individual items. This will be 0 if the loop does not support paging.
loop.pageSizeTotal number of items on 1 single page. This will be 0 if the loop does not support paging.
comment_commentThe actual comment.
comment_idThe unique id for this comment.
comment_midThe mediaitem for which this was a comment to.
comment_offsetThe offset of the comment in the requested list.
comment_owner_idThe user-id from the person who owns the commented file.
comment_owner_nameThe username from the person who owns the commented file.
comment_poster_nameThe username of the person making the comment.
comment_timeThe time the comment was made.
comment_uidThe 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-->