The ChannelList component allows you to easily loop through a list of channels for your vhost.
The following example creates a list of the channels in the application, displaying their id, name, email address and description.
- ID: {$$channel.id}, name: {$$channel.name}, emailaddress: {$$channel.emailaddress}, description: {$$channel.description}
Name | Required | Default | Description |
---|---|---|---|
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 | |
mediaAutoDeleteSettings | Optional | If `mediaAutoDeleteSettings` is not set, then all the channels in the vhost are returned. If it is set to 1, then only the channels with delete_media_moderationstatus > 0 and delete_media_interval > 0 are returned. If it is set to 0, then only the channels with delete_media_moderationstatus = 0 and delete_media_interval = 0 are returned. | |
noChildren | Optional | false | If set to true, the component will only return channels that don't have parents in this vhost |
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 | |
order | Optional | Order to sort channels in. One of the following: 'name ASC', 'name DESC', 'shortname ASC', 'shortname DESC', 'id ASC', 'id DESC', 'createdDate ASC', 'createdDate DESC' | |
parentId | Optional | If set - the component returns only channels that are children of the given channel. Cannot be used with noChildren specified as only the channels without parents in the given vhost will be returned |
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.count | The count of the current item in the loop. (Will contain 1,2,3,4,5 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. |
channel.created | The date and time the channel was created. |
channel.description | A natural-language description of the purpose of the channel. This is defined in the Media Factory. |
channel.emailaddress | The email address used to email media into the channel. Note: A different email has to be used for each channel. |
channel.id | The id of the channel. |
channel.name | The name of the channel. |
channel.shortname | The 'shortname', as defined in the Media Factory. |
channel.parentchannel | ID of the parent channel of this channel. If the given channel does not have a parent - 0 is returned |
channel.visibility | The visibility that has been set for the channel, "SHOWN" or "HIDDEN". Hiding a channel does not make the media within private, hidden or otherwise inaccessible. |
channel.delete_media_interval | This setting works together with `channel.delete_media_moderationstatus` to delete media from the system forever, and does not set the media status to deleted. This is the media auto-delete interval setting for the channel; it is an integer with value signifying the days to keep the media in our system from time of upload before deleting them from the system forever. Examples: 30: means delete media 30 days after it has been uploaded 0 means do not delete media automatically, even if `channel.delete_media_moderationstatus` is set. *** NOTE *** The setting `channel.delete_media_moderationstatus` has to be set to a value greater than 0 for this function to work. |
channel.delete_media_moderationstatus | This setting works together with `channel.delete_media_interval` to delete media from the system forever, and does not set the media status to deleted. This is the media auto-delete moderationstatus setting for the channel; it is an integer with the following possible values: 0: Do Not Delete Media Automatically (even if `delete_media_interval` is set) 1: Delete All Media Automatically, after the specified `delete_media_interval` 2: Delete Trashed Media Automatically, after the specified `delete_media_interval` 3: Delete Deleted Media Automatically, after the specified `delete_media_interval` 4: Delete Denied Media Automatically, after the specified `delete_media_interval` *** NOTE *** The setting `channel.delete_media_interval` has to be set to a value greater than 0 for this function to work. |
Note:
With the exception of loop.noResults, all template variables will exist only within the inner fm:Loop component.
The following example creates a list of the channels displaying their rows with alteranting CSS references.
<fm:ChannelList evenClass="even">
<ul>
<fm:Loop>
<li class="{$loop.evenClass}"><a href="/channel/{$$channel.id}">{$$channel.name}</a></li>
</fm:Loop>
<fm:NoResults>
<li>No channels could be found in this vhost!</li>
</fm:NoResults>
</ul>
</fm:ChannelList>