Start page
Start page

Start page / Template development / Template syntax / System objects / #listitem

#listitemAvailable from FirstSpirit Version 4.0

The system object: #listitem is available in the format template with the abbreviation li . Unlike the system object: #list (which returns information on the whole list) the system object: #listitem returns information on an individual list item.

Lists can be entered and maintained in the following input components:

The general syntax of the system object is as follows:

$CMS_VALUE(#listitem.METHOD)$

The following table lists the methods of the system object: #listitem :

Invocation

Meaning

Return data type

#listitem.index

Number of the current list element. The counting begins with 1, if the parameter: #list.start was not set, otherwise with the value of #list.start.
The invocation corresponds to the wildcard %index% for the input in the input component User-defined text in a list.

Integer

#listitem.indexText

Labelling of the current list element. This corresponds to the labelling displayed in the client in front of the list element.

List type User-defined text:
TemplateDocument

other list type:
String

#listitem.pre

Returns the value entered in the list by the editor for the input component: User-defined text . The return value is uninterpreted, i.e. wildcards (e.g. %count%, %index% etc.) are not replaced.

String
(character string)

   

1st Example: Automatic list numbering taking into consideration a starting value

<li>
$CMS_VALUE(#listitem.index)$ / $CMS_VALUE(#list.count2)$: $CMS_VALUE(#content)$
</li>

The example outputs a list element with automatic numbering. When using #listitem.index a different starting value is automatically taken into account for the numbering (see also listDefaultConfig parameter of the input components DOM and DOMTABLE). In order for the starting value to also be taken into account for the numbering of the last list element, #list.count2 can be used.

Exemplary output:

<li>
257 / 261: 1st Value
</li>
<li>
258 / 261: 2nd Value
</li>
<li>
259 / 261: 3rd Value
</li>
<li>
260 / 261: 4th Value
</li>
<li>
261 / 261: 5th Value
</li>

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2013-12-09