fm:MediaCollectionList


The fm:MediaCollectionList component lists the collections that a media is in.
It can do the following:

  • sort the collection by name or id
  • show a particular page of results
  • set an offset for the results
  • set the page size.

Example 1

The following example lists the collections that contain media id 5447187, and displays their id, name and description.
It also sorts the collections by their names in an ascending order (this is the default, so the collection would still be shouwn like this even if this parameter would not be provided), sets the number of collections to be shown on a page to 10, and starts on the first page of the results.

<fm:MediaCollectionList> <fm:Loop mid="5447187" sort="name ASC" pageSize="10" startPage="0" > Collection id: {$$collection_id} <BR> Name: {$$collection_name} <BR> Description: {$$collection_description} <BR> </fm:Loop> <fm:NoResults> No articles were found! </fm:NoResults> </fm:MediaCollectionList>

Supported attributes

NameRequiredDefaultDescription
offsetOptional0Determines the number of collections skipped when showing your list. So an offset of 5 means that the 6th collection in the application will be the first one shown in your list (if you set the startPage to 0).
pageSizeOptional30Is the number of collections that will be displayed on a page.
sortOptionalname ASCThe parameter that the collection list is ordered by. The 2 options are 'name' and 'id'.
startPageOptional0Sets the page that you want to see. Keep in mind that 0 is the first startPage for the collection list, 1 is the second page, and so on.

Template variables

NameDescription
id(Integer) The id of the collection.
vhost(Integer) The vhost id of the application.
thumbnail(String) The url for the collection thumbnail.
type(Integer) The collection type: can be 1 (Manual) or 2 (Saved search).
name(String) The name of the collection.
description(String) The description of the collection.
created(Date/Time) The date the collection was created.
baseurl(String) The base url of the collection.
channel(Integer) The channel of the collection.
addtotop(Integer) Determines if media added to a manual collection is placed at the top or bottom of the list.
autoactive(Integer) Determines whether media added to a manual collection is made active or pending automatically.

Example 2

The following example lists the collections for an application, and displays their id, name and date/time that they were created.
It also sorts the collections by their ids in an descending order, sets the offset to 1 ( by skipping the first collection), sets the number of collections to be shown on a page to 5, and starts on the second page of the results (the first page would have startPage="0").

<fm:MediaCollectionList> <fm:Loop sort="id DESC" offset="1" pageSize="5" startPage="1" > Collection id: {$$collection_id} <BR> Name: {$$collection_name} <BR> Created: {$$collection_created} <BR> </fm:Loop> <fm:NoResults> No articles were found! </fm:NoResults> </fm:MediaCollectionList>

See also