DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

List of available markers

Content markers

FIELD

Name
###FIELD.myField###
Description
This is the most common marker that deals with content of the database. When possible, try to make correspond the name of the marker with the name of the field. Templatedisplay will be able to guess automatically the mapping. Click on it to start the mapping process.

OBJECT

Name
###OBJECT.myValue###
Description
Attach some TypoScript to this marker. Same configuration options than FIELD markers but no field associated with.

LABEL

Name
###LABEL.myField###
Description
The label of the field is translated according to the language of the website. To have a correct translation, the LABEL must have a proper TCA.

LLL

Name
###LLL:EXT:myExtension/Resources/Private/Language/locallang.xlf:myKey###
Description
When no TCA is provided or an external string must be translated, use this syntax for translating a chain of character.

EXPRESSION

Name
###EXPRESSION.key:var1|var2###
Description

Calls on the expression parser of extension “expressions” to resolve any well-formed expression.

Example:

###EXPRESSION.gp:clear_cache###

will retrieve the value of a GET/POST variable called “clear_cache”.

FILTER

Name
###FILTER.myTable.myField###
Description
Value of a filter. MyTable is optional and depend of the filter naming.

SORT.sort

Name
###SORT.sort###
Description
Value of the sort. The most probably a field name.

SORT.order

Name
###SORT.order###
Description
Value of the order. Can be "ASC" or "DESC"

SESSION

Name
###SESSION.sessionName.order###
Description
Access information stored in the session.

COUNTER

Name
###COUNTER###
Description

The counter is automatically incremented by 1. This syntax makes sense inside a LOOP and can be used for styling odd / even rows of a table for example. The syntax may looks like this:

<!--IF(###COUNTER### % 2 == 0)-->class="even"<!--ELSE-->class="odd"<!--ENDIF-->

In the case of a LOOP in a LOOP the second COUNTER remains independent.

<!--LOOP(pages)-->
        <div>counter 1 : ###COUNTER###</div>
        <!--LOOP(tt_content)-->
                <div>counter 2 : ###COUNTER###</div>
        <!--ENDLOOP-->
<!--ENDLOOP-->

COUNTER(loop_name)

Name
###COUNTER(loop_name)###
Description

This kind of counter is handy in case of LOOP in a LOOP. Let's assume, we need to access the value of the parent COUNTER in a child's LOOP.

<!--LOOP(pages)-->
        <div>Some value</div>
        <!--LOOP(tt_content)-->
                <div>counter pages: ###COUNTER(pages)###</div>
        <!--ENDLOOP-->
<!--ENDLOOP-->

PAGE_BROWSER

Name
###PAGE_BROWSER###
Description
If extension "pagebrowse" is installed and correctly loaded, displays a universal page browser. Other page browsers are possible but must be handled with a hook.

RECORD

Name
###RECORD(tt_content, 12)###
Description

Call in the template it self an external record. Very handy for including records in a records.

If using a FAL file id as a template reference (see above), the records pointed to using this marker will be properly recorded in references (sys_reference).

HOOK

Name
###HOOK.myHook###
Description
See section about hooks

TOTAL_RECORDS

Name
###TOTAL_RECORDS###
Description
Returns the total number in the main of records without considering a possible limit . To have a glimpse on the data structure, add the parameter "debug[structure]" in the URL. The value ###TOTAL_RECORDS### corresponds to the cell "totalCount" of the main structure (level 1). Make sure you have a backend login to see the table.

SUBTOTAL_RECORDS

Name
###SUBTOTAL_RECORDS###
Description
Returns the total of records in the main data structure considering a possible limit . To have a glimpse on the data structure, add the parameter "debug[structure]" in the URL. The value ###SUBTOTAL_RECORDS### corresponds to the cell "count" of the main structure (level 1). Make sure you have a backend login to see the table.

TOTAL_RECORDS(tablename)

Name
###TOTAL_RECORDS(tablename)###
Description
Returns the total of records corresponding to a table name without considering a possible limit .

SUBTOTAL_RECORDS(tablename)

Name
###SUBTOTAL_RECORDS(tablename)###
Description
Returns the total of records corresponding to a table name considering a possible limit.

RECORD_OFFSET

Name
###RECORD_OFFSET###
Description
Return the page offset. The page offset corresponds to the current position inside a global record set. This marker is useful when displaying a page browser. See marker ###PAGE_BROWSER###. You can have something like this: ###RECORD_OFFSET### / ###TOTAL_RECORDS### which will display the current position among the total number of records.

START_AT

Name
###START_AT###
Description

Return the position of the first record returned by a subset, considering a possible limit.

This marker is useful when displaying a page browser like this one :

Records 1 – 10 of 2000 in total

which would be coded like this in the template:

Records ###START_AT### – ###STOP_AT### of ###TOTAL_RECORDS### in total

STOP_AT

Name
###STOP_AT###
Description

Return the position of the last record returned by a subset, considering a possible limit.

See ###START_AT### above.

Structure Markers

LOOP

Name

<!--LOOP(loop_name)-->

<!--ENDLOOP-->

Description
Where loop_name is a table name.

IF

Name

<!--IF(###FIELD.maker### == 'value')-->

<!--ELSE-->

<!--ENDIF-->

Description

Allows to display conditional content. Be careful to use parentheses around the condition. The ELSE part is optional.

Warning

It is not possible to nest IF markers.

EMPTY

Name

<!--EMPTY-->

<!--ENDEMPTY-->

Description
This part is displayed only if the Data Structure is empty. Please mind that the rest of the template is still displayed.

Functions

PHP function

Name
FUNCTION:php_function("###MARKER###",parameter1,...)
Description

A PHP function. No simple / double quote required.

Examples:

FUNCTION:str_replace(P ,X, ###LABEL.title###)
FUNCTION:str_repeat(###LABEL.title###,2)
FUNCTION:md5(###LABEL.title###)

LIMIT

Name
LIMIT(###MARKER###, 4)
Description

Limit the number of words in a marker.

Examples:

LIMIT(###FIELD.description###, 4) will return the first 4 words of field description

COUNT

Name
COUNT(tableName)
Description

Return the number of records from the Data Structure.

Tip

Add parameter debug[structure] in the URL to see the Data Structure. (Works with a BE login).

Examples:

COUNT(tt\_content) will return the number of records in table tt_content

PAGE_STATUS

Name

PAGE_STATUS(404)

PAGE_STATUS(404, page/404/)

PAGE_STATUS(404, pid:30)

PAGE_STATUS(301, new/page/)

Description

If the Data Structure is empty, send the appropriate header and redirect link when needed.

For the 404 status, leaving the redirect URL empty will make it fall back on the internal page not found handling of TYPO3.

You can also specifiy a page uid to redirect to, using the "pid:" syntax. In this case, the query string is added to the link.

Escaping markers

In the rare case where you content might contain a part like ###foobar###, it will be stripped at the end of the rendering, because templatedisplay cleans up all unreplaced markers. If you need to display such content, you need to escape the hash-characters, like \#\#\#foobar\#\#\#. This will be replaced by ###foobar### at the end of the processing, but after the clean up of unused markers.