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


The system object #fs_catalog is available in the templates which are used by elements of a FS_CATALOG input component. In other words: if a section or link in an FS_CATALOG input component is rendered the system object is available in the referenced section or link template.

If #fs_catalog is used in a template and this is rendered outside of FS_CATALOG the return is null. In addition, an error is displayed in the preview/generation log. Therefore it is recommended, before using the system object #fs_catalog, to check whether it is null or not:


The two intended uses of #fs_catalog are:

  1. Determination whether the rendered element is located in an FS_CATALOG or not
  2. Determine the number of elements contained in an FS_CATALOG

Important The invocation of $CMS_VALUE(#fs_catalog) (without method invocation) results in an endless loop which is logged in the preview/generation log (ERROR: endless loop in template?).
Important The system object #fs_catalog is not available for the output of an FS_CATALOG input component with a $CMS_FOR(...)$ instruction! The output of the number of elements in the input component can however also be realised in the instruction with .size:
$CMS_FOR(card, st_catalog)$
$CMS_VALUE(#for.index + 1)$/$CMS_VALUE(st_catalog.size)$: $CMS_VALUE(card)$

The individual invocations and their meaning:



Return data type


Is the element just rendered part of an FS_CATALOG input component or not.
true: the element is not part of an FS_CATALOG input component.
false: the element is part of an FS_CATALOG input component.

(Boolean value)


Number of elements in an FS_CATALOG input component.



Examples of #fs_catalog

Several examples of use of the instruction within templates are shown in the following. The examples are intended to clearly show the specific effect of the instruction and provide help for the template developer when creating their own templates.

Important The examples displayed here must be adjusted for use within a project! For example, variable names must be changed to the specific variable names of the project in which the instruction is to be used.

1st Example: Numbered output of sections

Definition of the FS_CATALOG input component (form):

<FS_CATALOG name="st_catalog">
<LANGINFO lang="*" label="Section list"/>
<TEMPLATES type="section">
<TEMPLATE uid="text"/>

Invocation of the input component (HTML template set):


Definition of the section template (“text”, form):

<CMS_INPUT_TEXT name="st_text">
<LANGINFO lang="*" label="Text"/>

Numbered output in the section template (HTML template set):

$CMS_IF(!#index.isNull && !#fs_catalog.size.isNull)$
$CMS_VALUE(#index + 1)$/$CMS_VALUE(#fs_catalog.size)$:

Apart from the value of the text input component the example also outputs the index (increased by one) and the total number of sections (e.g. “1/3”).


1/3: 1st Section
2/3: 2nd Section
3/3: 3rd Section

© 2005 - 2023 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2023.10 | Data privacy