The List Smartlet (sml_List)

Many of the overviews and lists in SmartInstant 2.0 are created using the sml_List smartlet. This item and the ones below it are lifted from the Documentation folder of the List smartlet.

A list can be defined by a DataTable property, a SQL query, or a number of parameters that define a SQL query through the QueryBuilder translation. Formatting of list items is handled by a scoped translation, so a site builder has full control over the way lists are rendered.

The number of items in the list can be restricted either by setting a maximum number or by enabling paging.

Parameters

The table below lists the common parameters for the list smartlet

Name Type Default Description
inputdata DataTable - An SXMLDataTable to be displayed. If this property is set, other input methods are ignored.
sqlquery String - A SQL query that will return the list to be displayed. Will not be used if the inputdata parameter is specified.
max Integer 20 The maximum number of items to be listed. Ignored if paging is used.
noresult String No Data Will be displayed if the list is empty.
cssclass String list CSS class to be added to the outer element of the lists. Note that the lst_format() translation is responsible for adding the class attribute to the relevant html element.
morelink String - A reference to a page where the rest of the list items are displayed. This parameter is of type String instead of Locator, because Locators can't be empty. If no morelink is specified, no link is displayed. Ignored if paging is used.
morelinktext String More... Text for the "more link". Ignored if paging is used.

The table below lists the parameters that pertain to paging. These parameters are only relevant if pagesize is set to a non-zero value.

Name Type Default Description
pagesize Integer 0 The maximum number of items per page. Set to a value larger than zero to enable paging.
data String - Used to return html to the client in a callback.
currentpage Integer 1 The number of the current page.
lastpage Integer - The total number of pages.
firstlinkcaption String First Text of the link to the first page.
prevlinkcaption String Previous Text of the link to the previous page.
nextlinkcaption String Next Text of the link to the nextpage.
lastlinkcaption String Last Text of the link to the lastpage.

The parameters that are fed to the QueryBuilder translation are described in this item.

Topics