{module_announcement}

Description

This module displays a list of news items to a page.

Syntax

{module_announcement render="item|collection" filter="item" itemid="newsId" noTemplate="true" effect="ajax" targetFrame="blank" sortType="alphabetical" collection="my_custom_collection_name" template="/folder/template.tpl"}

Note: When using named parameters always wrap the individual parameters in double quotes. Also, do note that modules using named parameters do not work for campaigns just yet.

Parameters

  • render - possible values are item or collection (the default is item). The render parameter indicates whether the template content is used to render a collection or to render a single item. Take a look at the render parameter's article for more details on how to use it
  • filter - filtering criteria for display and can be one of the following:
    • item - individual item
    • all - all items
    • latest - latest items
    • latestClassified - latest items in a category
    • random - random item
    • randomClassified - displays a random item in a particular category
    • classified - all the items in a category
  • itemid – the itemID or the categoryId, depending on the filter type can be hoe many items to display
  • noTemplate – if you want to force the item not to use a site-level template when displayed pass in true, otherwise leave empty or you can also pass false
  • effect – enter ajax (see the examples below) if you want to take advantage of the latest web technologies for a better customer experience
  • targetFrame – the frame in which to open the item in
  • rowLength - this parameter is only used when the filter is either "l" or "cl" and dictates how many items are rendered per row
  • resultsPerPage - number of items per page
  • hideEmptyMessages - hide the default text rendered when no announcements are found
  • sortType - if you leave this parameter blank, by default announcements will be sorted from the latest to the oldest where the latest is displayed first
    • alphabetical - will sort announcements alphabetically
    • datereverse - will sort announcements in the reverse order, that is from the oldest to the latest
  • collection - use this if you need to access the module's Liquid output tags
  • template - optional, for this module this can either represent the path of the custom template you want to use, or use a blank value (template="") if you need to suppress the original output and use Liquid output tags instead

Layouts

Examples

  • {module_announcement filter="all" targetFrame="_parent"} - will display all news items and open them in parent frame
  • {module_announcement filter="latest" itemid="5"} - will display the latest 5 news
  • {module_announcement filter="random" noTemplate="true" effect="ajax" targetFrame="_blank" sortType="datereverse"} - will open a random item in a new window and will not apply the template and will use the Ajax effect where the detail content opens right underneath the news name and all the news items will be displayed from the oldest to the latest
  • {module_announcement filter="latestClassified" itemid="34392" effect="ajax" resultsPerPage="5"} - will display the 5 latest news items in the category with the ID 34392
  • {module_announcement filter="all" effect="ajax" targetFrame="_blank" template="/Layouts/Custom/news.tpl"} - will display all the news items using the "ajax" effect using the news.tpl custom template
  • {module_announcement filter="all" collection="collection1" template=""} - in this case nothing will be displayed, however the module's Liquid tags will become available in the collection1 collection.

Syntax

{module_announcement, filter, id, noTemplate, effect, target, reserved, resultsPerPage, reserved, length, sort}

Parameters

  • filter - filtering criteria for display and can be one of the following:
    • i - individual item
    • a - all items
    • c - all items in some category
    • cl - latest items in some category
    • l - latest items
    • r - random item
    • cr - displays a random item in a particular category
  • id – system generated (do not change)
  • noTemplate – if you want to force the item not to use a site-level template when displayed pass in true, otherwise leave empty
  • effect – enter ajax (see the examples below) if you want to take advantage of the latest web technologies for a better customer experience
  • target – the frame in which to open the item in
  • reserved - for use in a future release
  • resultsPerPage - number of items per page
  • length - this parameter is only used when the filter is either "l" or "cl" and dictates how many items are rendered per row
  • sort - if you leave this parameter blank, by default announcements will be sorted from the latest to the oldest where the latest is displayed first
    • alphabetical - will sort announcements alphabetically
    • datereverse - will sort announcements in the reverse order, that is from the oldest to the latest

Layouts

Examples

  • {module_announcement,a,,,,_parent} - will display all news items and open them in parent frame
  • {module_announcement,l,5} - will display the latest 5 news
  • {module_announcement,r,,true,ajax,_blank,,,,,datereverse} - will open a random item in a new window and will not apply the template and will use the Ajax effect where the detail content opens right underneath the news name and all the news items will be displayed from the oldest to the latest
  • {module_announcement,cl,34392,,ajax,,,,,5} - will display the 5 latest news items in the category with the ID 34392
  • {module_announcement,a,,,ajax,_blank template="/Layouts/Custom/news.tpl"} - will display all the news items using the "ajax" effect using the news.tpl custom template