List.pm
NAME
Communiware::DE::List - Dynamic element List
SYNOPSIS
<:List filter template sortorder grouping cutting key=value ...:>
DESCRIPTION
Creates list of items, using element template passed as one of arguments.
ARGUMENTS
- filter
- Specification of filter.
- template
- Id of template which would be used to show.
- sortorder
- Specification of sorting. Can be one of three forms:
- grouping
- Specifies HTML code which should be output between groups of items. Groups of items are defined as all items which have same values of certain attribute. may be ATTRIBUTE:tag(TAG), ATTRIBUTE:include(template) or ATTRIBUTE:attr().
-
If tag is specified, then <TAG> would be output each time as ATTRIBUTE increases and </TAG> each time it decreass.
-
If tag is specified with attributes, i.e LEVEL:tag(DIV class=xxx) closing tag would be, of course, printed without attributes.
-
Note, that any substitution in this argument would occur when List dynamic element is parsed, i.e. before filter is executed.
-
Typical usage - LEVEL:tag(BLOCKQUOTE) or LEVEL:tag(DL) to create proper identation for tree-like sort. Include is executed only once per each change of group attribute.
-
Attr means to output nothing special. Just provide context attribute PREV_ATTRIBUTE, containing value of grouping attribute in preceding list element. (This attribute is provided if any valid grouping specification is specified)
- cutting
- Numeric value which indicates how many items should be shown at most. In difference of c:n sorting arg using of this arg provides neccessary context for use of dynamic element Continuation. the Communiware::DE::Continuation manpage. May be followed by ! to avoid interaction with Continuation
- key=value ...
- Other (named) parameters.
- list_id=some_id
- Identifies this list on this page. If it specified, the Communiware::DE::Pager manpage can be used to manage offset of data entries in this list.
-
First character of list identifier must be from [:alpha:] class. Rest can contain any latin character, number or '_'.
-
Warning! Results of List with defined list_id parameter are cached in context of current document item. Thus second and later call of same List is fast but you can not change filter and sotr order.
-
HINT! Please use db instead of <:Skip:>
- delayed_check=1
- Delays rights check so that rights are checked last, immediately before check for cutting. It may speed up some lists generation in situations like ``filter returns several hundreds possibly protected items but we need only five items''. If we need all the returned items, it slows down execution significantly. You are warned. Default is false, that is, do not delay check.
-
Comma separated cist of attribute names, prefixed by + for ascending
sort or - for descending.
s:list of fields - straight sort according to given list of
attributes.
i:list of fields - inverse sort according to given list of
attributes
t:id,parent,list of fields - tree sort. id is attribute which is
used to uniquely identify given item (typically ITEM_ID) parent
should contain id of parent element for non-root nodes an other fields
are used to sort siblings.
Tree sort adds attribute LEVEL to list element context, which is equial
to distance from tree root.
c:number - this is ugly hack. It mean ``Truncate list after first n
values, and remains here for compatibility with early versions of
Communiware which do not support cutting arg.
SEE ALSO
Communiware::DE::Loop - on creating a list of elements without an additional template using.