Development

Insert tags

Insert tags are wildcards that will be replaced with certain values when a page is printed to the screen. They offer a wide range of applications like displaying the current date, addressing front end users by their names or including files. Insert tags can be used anywhere, e.g. in headlines, modules or forms. Since insert tags are only replaced when the page is printed to the screen, they can also be used on cached pages.

{{article::ID}}

This insert tag will be replaced with a link to an article. Replace ID with the article ID.

{{article_teaser::ID}}

This insert tag will be replaced with the teaser of an article. Replace ID with the article ID.

{{news_teaser::ID}}

This insert tag will be replaced with the teaser of a news item. Replace ID with the news ID.

{{event_teaser::ID}}

This insert tag will be replaced with the teaser of an event. Replace ID with the event ID.

{{date}}

This insert tag will be replaced with the current date according to the global date format.

{{date::format}}

This insert tag will be replaced with the current date according to the format string that you can supply as second argument. For example, replacing format with Y/m/d will ouput 2007/03/07. You can find more information about date formatting on http://www.php.net/date.

{{email::address}}

This insert tag will be replaced with a clickable link to the e-mail address specified.

{{env::page_id}}

This insert tag will be replaced with the id of the current page (env = environment).

{{env::page_alias}}

This insert tag will be replaced with the alias of the current page (env = environment).

{{env::page_name}}

This insert tag will be replaced with the name of the current page (env = environment).

{{env::page_title}}

This insert tag will be replaced with the title of the current page (env = environment).

{{env::parent_alias}}

This insert tag will be replaced with the alias of the parent page (env = environment).

{{env::parent_name}}

This insert tag will be replaced with the name of the parent page (env = environment).

{{env::parent_title}}

This insert tag will be replaced with the title of the parent page (env = environment).

{{env::main_alias}}

This insert tag will be replaced with the alias of the parent main page (env = environment).

{{env::main_name}}

This insert tag will be replaced with the name of the parent main page (env = environment).

{{env::main_title}}

This insert tag will be replaced with the title of the parent main page (env = environment).

{{env::website_title}}

This insert tag will be replaced with the title of the website root (env = environment)..

{{env::url}}

This insert tag will be replaced with the current URL (e.g. http://www.yoursite.com).

{{env::path}}

This insert tag will be replaced with the current URL and the path to the TYPOlight directory (e.g. http://www.yoursite.com/path).

{{env::request}}

This insert tag will be replaced with the current request (e.g. home.html).

{{env::referer}}

This insert tag will be replaced with the URL of the last page visited.

{{env::ip}}

This insert tag will be replaced with the IP address of the current visitor.

{{iflng::LN}}

This insert tag will be removed if the page language does not match the tag language LN (replace LN with the ISO language code). Use it to insert language specific content into a module or form.

{{iflng::en}}Your name{{iflng}}{{iflng::de}}Ihr Name{{iflng}}

The above example will be replaced with "Your name" on english pages, "Ihr Name" on german pages and an empty string on all other pages.

{{image::filename?param=value&param2=value2}}

With this insert tag, you can insert the thumbnail of an image. Supported parameters are:

Parameter Replaced with
width Thumbnail width
height Thumbnail height
alt Alternative text
class CSS class
rel rel-attribute (e.g. "lightbox")

Thumbnails are stored in "system/html". Here is a usage example:

{{image::tl_files/music_academy/james-wilson.jpg?width=80&height=120&alt=James Wilson&class=ce_image}}

{{file::file.php}}

This insert tag will be replaced with the ouput of file file.php. Included PHP files have to be stored in folder templates. It is also possible to add arguments:

{{file::file.php?arg=val&arg2=val2}}

{{insert_article::ID}}

This insert tag will be replaced with the output of the article specified. This is useful for including the content of one article in a different article or news article.

{{insert_content::ID}}

This insert tag will be replaced with the output of the content element specified. This is useful for including a content element from one article in a different article or news article.

{{insert_module::ID}}

This insert tag will be replaced with the output of the module specified. This is useful for including a module in an article, page layout or news article.

{{lang::ID}}

Use this insert tag to mark foreign words in your text (accessibility).

{{lang::fr}}Au revoir{{lang}}

will be replaced with

<span lang="fr" xml:lang="fr">Au revoir</span>

{{last_update}}

This insert tag will be replaced with the date and time of the last update according to the global date format.

{{last_update::format}}

This insert tag will be replaced with the date of the last update according to the format string that you can supply as second argument. For example, replacing format with Y/m/d will ouput 2007/03/07. You can find more information about date formatting on http://www.php.net/date.

{{link::page}}

This insert tag will be replaced with a link to an internal page. Replace page with the page ID or alias.

{{link::back}}

This insert tag will be replaced with a link to the last page visited. You can also use it with link_open, link_url and link_title.

{{link::login}}

This insert tag will be replaced with a link to the login page of the current user and is only shown if there is a logged in user. You can also use it with link_open, link_url and link_title.

This insert tag will be replaced with the opening tag of a link to an internal page. Thus, you can use a custom text or an image as link:

{{link_open::page}}my text</a>

This insert tag will be replaced with the URL of an internal page. Thus, you can link to an internal page:

<a href="{{link_url::page}}">my text</a>

This insert tag will be replaced with the title of an internal page and can be used in TITLE or ALT attributes:

<a href="{{link_url::page}}" title="{{link_title::page}}">my text</a>

{{user::property}}

This insert tag will be replaced with a particular front end user property that you can supply as a second argument. For example, you can address a front end user by his name using {{user::firstname}} {{user::lastname}}. Here is a list of available properties:

Property Replaced with
id Unique ID
firstname First name
lastname Last name
company Company
email E-mail address
street Street
postal Postal code
city City
state State
country Country
phone Phone number
mobile Mobile phone number
fax Fax number