fm:ChannelList
The ChannelList component allows you to easily loop through a list of channels for your vhost.
Example
<fm:ChannelList>
<ul>
<fm:Loop>
<li>{$$channel.name}</li>
</fm:Loop>
</ul>
</fm:ChannelList>
Supported attributes
| 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 | |
| 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 |
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. |
| 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.id | The id of the channel. |
| channel.name | The name of the channel. |
| channel.shortname | The 'shortname', as defined in the Media Factory. |
With the exception of loop.noResults, all these template variables will only exist within the inner fm:Loop component.
See also
More examples
<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>
developer documentation r15960