Querying File Types

The entries in an automatically generated table of contents can be restricted to a particular file type by using the following query (e.g. all ressources for download). It is also possible to exclude files of a particular type from the table of contents.

Use the following code to include only files of type document in the table of contents:

<npsobj name1="objType" value2="document" condition="isEqual">
  ...
</npsobj>

In this example name1 specifies the name of the field whose value is to be compared with the value of the constant value2. In binary conditions the subscripts 1 und 2 are used to define the order of the operands. This is necessary because there are operations (hasPrefix, hasSuffix and matches) in which the order of the operands is significant. Since the order of tag attributes is meaningless in HTML, the tag attribute names must be used to indicate the order. This is the purpose of the subscripts.

Analogously to the example above you can use value2="publication" to make only folders, and value2="generic" to make only ressources appear in the table of contents. To allow only folders and documents to appear, exclude files of type ressource:

<npsobj name1="objType" value2="generic" condition="isNotEqual">
  ...
</npsobj>

Alternatively you can use the parameter negate to reverse a condition. The following code has the same result as the code in the previous example:

<npsobj name1="objType" value2="generic" condition="isEqual" negate>
  ...
</npsobj>

If you wish to compare two field values, please use name1 and name2 as NPSOBJ parameters.