5.3.11. List of Articles
Purpose:
Select the list of articles according to the given
constraints and current environmental parameters. The Publication,
Language, Issue, Section, Article parameters may not be defined outside
List Article statement; inside the statement however, all these
parameters are defined. The code between "List .. Article.. " statement
and "ForEmptyList" (if used) or "EndList" is repeated for every article
in the list. When the list of article is empty the code in between
"ForEmptyList" and "EndList" is executed once.
Syntax:
List [length <integer_value>] [columns <integer_value>]
Article [<list_of_article_constraints>] [<list_of_article_type_constraints>]
[order <order_condition>]
<list_of_instructions>
[ForEmptyList [<list_of_instructions>]]
EndList [Article]
where
length <integer_value> where <integer_value> specifies list_length forces the list to have at most list_length items. If the list contains more items than list_length items the ones not fitting in can be listed using If NextItems/PreviousItems statements.
columns <integer_value> where <integer_value> specifies columns_number
sets an environment variable. This is incremented as if the items would
be placed in a table cell. The counting starts from one and the
variable is incremented for every new element. When it reaches the
maximum value it is reset to one. This is very useful in building
tables of data. For details see If List.
<list_of_instructions>
may contain any statement except: "Language", "Publication", "List
Issue", "Issue", "List Section", "Section", "List Article", "Article".
<list_of_article_constraints>= | [<article_constraint>] <list_of_article_constraints> | <article_constraint> |
name, number, upload_date are self explaining article attributes
keyword: all articles containing the specified keyword (and respecting all the other constraints) will be in the list
OnFrontPage: articles having "Show article on front page" flag in
<switch_operator> relation with <switch_value> will be
selected; for details see Creating articles within a section
OnSection: articles having "Show article on section page" flag in
<switch_operator> relation with <switch_value> will be
selected; for details see Creating articles within a section
public: articles having "Allow users without subscription..." flag in
<switch_operator> relation with <switch_value> will be
selected
... <article_type_attribute> ...:
articles being of <article_type> and having
<article_type_attribute> in <attribute_type_operator>
relation with <attribute_type_value> will be selected; for
details see Defining article types
topic: if "is" operator is used, articles having specified topic in
their list of topics will be selected; if "not" operator is uses
articles not having specified topic in their list of topics will be
selected
Note on topics: the
topic name must be written in the following format:
“<topic_name>:<language_code>”. Campsite is able to store
topics in multiple languages, yet the user interface managing the
topics wasn't updated and it is only capable of managing topics in
English language. All the topics are automatically assigned the English
language.
Examples of valid topic names: “sports:en”, “health:en” etc.
<list_of_article_type_constraints>= | [<article_type_constraint>] <list_of_article_type_constraints> | <article_type_constraint> |
<article_type_constraint>=type <string_operator> <string_value>
<order_condition>= | bydate desc|asc |bynumber desc|asc |byname desc|asc |
Inside
the List, the data context is defined by the constraints applied to the
current article for every processed line. The data context is restored
after the list processing.
Constraints:
Inside List Article the following statements are forbidden:
Language
Publication
List Issue
Issue
List Section
Section
List Article
Article
List Article statement cannot be used inside List Subtitle, List SearchResult statements.
add a note
User Contributed Notes
5.3.11. List of Articles
There are no user contributed notes for this page.