Campsite 2.3 User Guide

Campsite 2.3 User Guide

Select your language:  
    Search:   
<5.3.20. If Section        5.3.22. If Allowed>

Print / Download:
Available languages: english Last update: 2005-08-16 09:58:07

5.3.21. If Article

Purpose:

Depending on the given condition, it runs the first (for true) or second (for false) list of instructions. It may be used anywhere in the template. It is used when printing information for different types of articles.

Syntax:

If [not] Article <condition>
<list_of_instructions>
[Else [<list_of_instructions>]]
EndIf [Article]

where

<condition>=

type <string_value>
|name <string_operator> <string_value>
|upload_date <date_operator> <date_value>
|has_keyword <string_value>
|OnFrontPage <switch_operator> <switch_value>
|OnSection <switch_operator> <switch_value>
|public
|defined
|fromstart
|translated_to <string_value>
|[<article_type>] <article_type_attribute> <attribute_type_operator> <attribute_type_value>

  • type: the condition is true if article type is <string_value>

  • name: the condition is true if article name is in <string_operator> relation with <string_value>

  • upload_date: the condition is true if article upload date is in <date_operator> relation with <date_value>

  • has_keyword: the condition is true if specified keyword is in article keywords list

  • public: the condition is true if the article is public (has the public flag set)

  • OnFrontPage: the condition is true if "Show article on front page" flag is in <switch_operator> relation with <switch_value>

  • OnSection: the condition is true if "Show article on section page" flag is in <switch_operator> relation with <switch_value>

  • defined: the condition is true if article parameter is defined

  • fromstart: the condition is true if actual value of article parameter is equal with the value from template start

  • translated_to: <string_value> must be a valid language code; the condition is true if the article has a translation into the language specified by the language code

  • ... <article_type_attribute> ...: the condition is true if the article is of <article_type> and <article_type_attribute> is in <attribute_type_operator> relation with <attribute_type_value>. <article_type_attribute> is an attribute specific to an article type; for details see Defining article types

The list of instructions may contain any instruction allowed in the current context. If it is used inside a list it must respect the constraints of the list (List Issue, List Section, List Article, List Subtitle, List SearchResult).

Constraints:

None.


add a note add a note User Contributed Notes
5.3.21. If Article
There are no user contributed notes for this page.

<5.3.20. If Section 5.3.22. If Allowed>

  Last update: 2005-08-16 09:58:07
Website powered by Docmint Last update: 2005-08-16 09:58:07
Total page time: 1.99352693558