Using the npsobj newslist Instruction

For the purpose of creating news lists in layouts, the NPSOBJ newslist instruction can be used in the following three ways:

  • List of all news in all channels:

    <npsobj newslist="all" length="20">
    Text evaluated for each news article
    </npsobj>
  • List of the news arictles assigned to at least one of the channels whose names are values of a field contained in the current document:

    <npsobj newslist="selected" name="Channel-Feld" length="20">
      Text evaluated for each news article assigned to at least one of
      the channels that have been specified indirectly.
    </npsobj>

    The field type must be one of string, text, enum, or multienum. With fields of the types string and text the values need to be separated by commas. With multi-selection fields the field values are used as channel names.

  • The list of news to which channels specified directly are assigned:

    <npsobj newslist="selected" value="ch1, ch2, ..." length="20">
      Text evaluated for each news assigned to one of the channels
    </npsobj>

A news article is never listed more than once in the generated news list even if it is assigned to more than one of the channels specified directly or indirectly.

Generated news lists contain only news articles whose publication date is in the past at the time of the export. Of course, the news list internally contains all of the files to which a channel has been assigned and whose format marks the file as a news article. The publication date corresponds to the creation time of the news file that can be determined via the valid from field of the working version. A news article that has been released accidentally can therefore be removed from the generated news list by specifying a publication date that lies in the future. Internally, the news article still exists unless the corresponding file has been deleted or its channels field has been cleared. A file is also removed from the internal news list when the channels are deleted to which the news article is assigned. However, this does not change the value of the channels field of the versions. The news article is not again placed into the news list when a deleted channel to which the article is assigned is created again.

When the Template Engine is used, all the files containing an NPSOBJ newslist instruction are evaluated again when files are changed or the channel configuration is modified. This is done to keep the news lists up-to-date. (The files are given a usesAll dependency.)