Translations
Info
All page names need to be in English.
en da  de  fr  it  ja  km  nl  ru  zh

TypoScript technical aspects

From TYPO3Wiki
Jump to: navigation, search

notice - This information is outdated

While some details may still apply in specific situations, this page was written for packages of TYPO3 that are no longer current.


notice - Draft

Change the {{draft}} marker to {{review}} when you need a reviewer for text and TypoScript. info

TYPOSCRIPT Technical Reference

This document describes technical details and aspects of TypoScript as used with TYPO3 4.0.0. It does not aim to be a User/Administrator Guide on how to create TS but it will surely help you understand how TS works and how it could get used. For a reference of available TS Properties and which surely is more suited for creating a quick TS read the TSref.

TS BNF-Notation

This is a try to define the Backus-Naur-Form (BNF) of TypoScript

Used sets

<alphanum_chars> ::= <num_chars> | <alpha_chars>
<alpha_chars> ::= <uppperalpha_chars> | <loweralpha_chars>
<upperalpha_chars> ::= <upperalpha_chars> | A | B | C | ... | Z
<loweralpha_chars> ::= <loweralpha_chars> | a | b | c | ... | z
<num_chars> ::= <num_chars> | 0 | 1 | 2 | ... | 9


Main structure

<start> ::=   <top_statement_list>
<top_statement_list> ::=   <top_statement_list> <top_statement>
                         |
<top_statement> ::=   <statement>
                    | <condition_line>
<inner_statement_list> ::=   <inner_statement_list> <inner_statement>
                           |
<inner_statement> ::=   <statement>

Condition part

<condition_line> ::=   T_LINESTART <condition_body>
<condition_body> ::=   <condition_expr>
                     | <condition_list>
                     | T_COND_GLOBAL
                     | T_COND_ELSE
                     | T_COND_END
<condition_list> ::=   <condition_list> <condition_operator> <condition_expr>
                     | <condition_expr> <condition_operator> <condition_expr>
                     
<condition_operator> ::=   <condition_operator_and>
                         | <condition_operator_or>
<condition_operator_and> ::=   T_CONDOP_AND_SYM          /* &&  */
                             | T_CONDOP_AND_TEXT         /* AND */
<condition_operator_or> ::=   T_CONDOP_OR_SYM            /* ||  */
                            | T_CONDOP_OR_TEXT           /* OR  */
<condition_expr> ::=   '[' condition ']'
<condition> ::=   <condition_key> = <condition_compare_list>
<condition_key> ::=   T_COND_BROWSER
                    | T_COND_VERSION
                    | T_COND_SYSTEM
                    | T_COND_DEVICE
                    | T_COND_USERAGENT
                    | T_COND_LANGUAGE
                    | T_COND_IP
                    | T_COND_HOSTNAME
                    | T_COND HOUR
                    | T_COND_MINUTE
                    | T_COND_DAYOFWEEK
                    | T_COND_DAYOFMONTH
                    | T_COND_MONTH
                    | T_COND_USERGROUP
                    | T_COND_LOGINUSER
                    | T_COND_TREELEVEL
                    | T_COND_PIDINROOTLINE
                    | T_COND_PIDUPINROOTLINE
                    | T_COND_GLOBALVARS
                    | T_COND_GLOBALSTRING
                    | T_COND_USERFUNC
<condition_compare_list> ::=   <condition_compare>
                             | <condition_compare_list>, <condition_compare>
<condition_compare> ::=   <condition_compareoperator_single> <condition_value>
                        | <condition_value_key> <condition_compareoperator_dual> <condition_value>
<condition_compareopartor_dual> ::=   <
                                    | >
                                    | =
<condition_compareopartor_single> ::=   <
                                      | >
                                      | =
                                      |


<condition_value_key> ::=   <variable_name>
                          | <variable_name> ':' <condition_value_subkey>
<condition_value_subkey> ::=    <variable_name>
                              | <condition_value_subkey> '|' <variable_name>
<condition_value> ::=   *
                      | <ts_constant>
                      | <comma_list_string>
<comma_list_string> ::=   <comma_list_string> <commalist_chars>
                        | <comma_list_chars>
??? correct ??? <comma_list_chars> ::=   <alphanum_chars>
                                       | <whitespace>
                                       | <arithmetic_operators>
                                       | <special_chars>
                                       | 
                                       | .
                                       | ?
                                       | !
                                       | .... a lot i guess .... :)

Statement part

The first line for <statement> defines an empty line.

<statement> ::=   T_LINESTART T_LINEEND
                |  T_LINESTART <objectkey> <assign> <objectvalue> T_LINEEND
                | T_LINESTART <objectkey> { T_LINEEND <inner_statement_list> T_LINESTART } T_LINEEND
                | T_LINESTART <objectkey> ( T_LINEEND <multiline_value> T_LINESTART ) T_LINEEND
<objectkey> ::=   <objectname>
                | <objectkey> . <objectname>
<objectname> ::=   <objectname> <objectname_chars>
                 | <objectname_chars>
<objectname_chars> ::=   <alphanum_chars>
                       | _ 
<assign> ::=   <
             | >
             | =
<objectvalue> ::=   <objectkey>
                  | . <objectkey>
                  | <nonewline_chars>
<multiline_value> ::=   <mutliline_line>
                      | <multiline_value> <multiline_line>
<multiline_line> ::=   T_LINESTART T_LINEEND
                     | T_LINESTART <noclosebrace_chars> T_LINEEND
                     | T_LINESTART <noclosebrace_chars> <nonewline_chars> T_LINEEND



Bernhard Kraft 10:00, 16 Apr 2006 (CET) [www.think-open.at]