Deprecated: Return type of Multilingual::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 681

Deprecated: Return type of Multilingual::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 687

Deprecated: Return type of Multilingual::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 691

Deprecated: Return type of Multilingual::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 708

Deprecated: Return type of Multilingual::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 699

Deprecated: Return type of Multilingual::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 721

Deprecated: Return type of SettingsIterator::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 741

Deprecated: Return type of SettingsIterator::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 749

Deprecated: Return type of SettingsIterator::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 745

Deprecated: Return type of SettingsIterator::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 757

Deprecated: Return type of SettingsIterator::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 753

Deprecated: Return type of Settings::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 841

Deprecated: Return type of Settings::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 845

Deprecated: Return type of Settings::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 849

Deprecated: Return type of Settings::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 863

Deprecated: Return type of Settings::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 874

Deprecated: Return type of Settings::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models.php on line 880

Deprecated: Return type of r7r\cms\sys\models\KVStorage::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 78

Deprecated: Return type of r7r\cms\sys\models\KVStorage::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 84

Deprecated: Return type of r7r\cms\sys\models\KVStorage::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 89

Deprecated: Return type of r7r\cms\sys\models\KVStorage::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 113

Deprecated: Return type of r7r\cms\sys\models\KVStorage::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 103

Deprecated: Return type of r7r\cms\sys\models\KVStorage::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 131

Deprecated: Return type of r7r\cms\sys\models\KVStorage::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 141

Deprecated: Return type of r7r\cms\sys\models\KVStorage::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 136

Deprecated: Return type of r7r\cms\sys\models\KVStorage::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 146

Deprecated: Return type of r7r\cms\sys\models\KVStorage::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/sys/models/KVStorage.php on line 126

Deprecated: Return type of r7r\ste\Scope::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/vendor/r7r/ste/src/ste/Scope.php on line 184

Deprecated: Return type of r7r\ste\Scope::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/vendor/r7r/ste/src/ste/Scope.php on line 180

Deprecated: Return type of r7r\ste\Scope::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/vendor/r7r/ste/src/ste/Scope.php on line 176

Deprecated: Return type of r7r\ste\Scope::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/laria/www/r7r/ratatoeskr/vendor/r7r/ste/src/ste/Scope.php on line 193

Warning: session_start(): Session cannot be started after headers have already been sent in /home/laria/www/r7r/ratatoeskr/main.php on line 50

Warning: Array to string conversion in /home/laria/www/r7r/ratatoeskr/templates/transc/usertemplates/some_useful_tags.php on line 25

Warning: Array to string conversion in /home/laria/www/r7r/ratatoeskr/templates/transc/usertemplates/purestatic.html.php on line 42
Templating reference – Ratatöskr

Ratatöskr

Templating reference

An advice before you start writing templates

Enable the debugmode of Ratatöskr. Login to the backend of your Ratatöskr installation and go to Administration > Settings and toggle the debugmode value to "enabled". After this, Ratatöskr will print out error messages, if you messed up your templates and will therefore make writing templates much easier.

Representations of different data in templates

Representation of an article

An article is represented as an array with these fields:

  • id – The database ID of the article.
  • urlname – The URL name of the article
  • fullurl – The full URL to the article
  • title – The title (HTML)
  • text – The full text of the article (HTML)
  • excerpt – The excerpt of the article (HTML)
  • custom – At the moment not used.
  • status – The numeric status of the article. 1: Live; 2:Sticky
  • section – Informations about the current section (see Representation of a section)
  • timestamp – The timestamp as a unix timestamp. Use STE's ste:date tag to transform this into something human readable.
  • tags – An array of tags. See Representation of a tag.
  • languages – An array that holds infomation about languages, in which this article is availabe at. The array keys are the language code (e.g. en, de, it, ...), the value is a URL to thie article in this language.
  • comments_allowed – Is empty, if comments are not allowed, otherwise this is not empty.

Representation of a section

A section is represented as an array with these fields:

  • id – The database ID of the section.
  • name – The name of the section.
  • title – The title of the section in the current language.

Representation of a tag

A tag is represented as an array with these fields:

  • id – The database ID of the tag.
  • name – The name of the tag.
  • title – The title of the tag in the current language.

Representation of a comment

A comment is represented as an array with these fields:

  • id – The database ID of the article.
  • text – The text of the article (HTML).
  • author – The autors name (HTML).
  • timestamp – The unix timestamp of this article. Use STE's ste:date tag to transform this into something human readable.

Variables

$current

Holds information about the currently displayed page.

Fields of $current:

  • article – Only set if a single article is shown (Use ste:if to detect this). Holds information about an article. (see Representation of an article).
  • section – Only set if a whole section is shown (Use ste:if to detect this). Holds information about an section. (see Representation of a section).
  • tag - Only set if all articles with the same tag should be shown (pseudo section _tags; use ste:if to detect this). Holds information about a tag. (See Representation of a tag).
  • page – Which subpage is shown? Useful with pageprev, pagenext and the page parameter of articles_get. Default: 1
  • commented – Non-empty, if the visitor has successfully written a comment.
  • comment_fail – If the user tried to comment, but the system rejected the comment, this will be set and will contain the error message.
  • comment_prev – If the user wanted to preview the article, this will be set and contain the HTML code of the comment.
  • styles – The styles, that should be loaded. You can also just use ste:styles_load.
  • url_fragments – Array of URL parts. Mainly used internally, so you really should not modify this one...
  • oldcomment – The data of the previously sent formular (subfields: name, mail, text). Only set inside the ste:comment_form tag.

Plugins might insert their own fields.

$language

The short form of the current language (e.g. "en", "de", "it", ...)

Tags

ste:articles_get

This tag will get all articles that match the passed criterias and will run it's content for every article.

Parameters:

  • var – (mandatory) The name of the variable, where the current article should be stored at. This variable will then be an array (see Representation of an article)
  • id – (optional) Filter by ID.
  • urlname – (optional) Filter by urlname.
  • section – (optional) Filter by section (section name).
  • status – (optional) Filter by status (numeric, 1 means "live" and 2 means "sticky". Hidden articles will always be ignored).
  • tag – (optional) Filter by tag (tag name).
  • sort – (optional) How to sort. Format: "fieldname direction" where fieldname is one of [id, urlname, title, timestamp] and direction is one of [asc, desc].
  • perpage – (optional) How many articles should be shown per page (default unlimited). How to use paging will be described in the Paging tags section.
  • page – (optional) On which page are we (starting with 1). (Default: 1; see the page field of $current)
  • maxpage – (optional) (variable name) If given, the number of pages are stored in this variable.
  • skip – (optional) How many articles should be skipped? (Default: none)
  • count – (optional) How many articles to output. (Default unlimited)

ste:section_list

This tag will loop through all sections.

Parameters:

  • var – (mandatory) The name of the variable, where the current section should be stored at. See Representation of a section.
  • exclude – (optional) Sections to exclude (comma seperated)
  • include_default – (optional) Should the default section be included? If yes, pass a non-empty text, otherwise a empty text. (default: No).

ste:article_comments_count

This tag will return the number of comments for a article.

Parameters:

  • article – (mandatory) The name of the variable, where the article is stored at.

ste:article_comments

Loop through all comments for an article.

Parameters:

  • var – (mandatory) The name of the variable, where the current comment should be stored at (see Representation af a comment).
  • article – (mandatory) The name of the variable, where the article is stored at.
  • sort – (optional) Should the comments be sorted chronologically (asc) or inverse (desc)? Default: asc

ste:comment_form

Generate a HTML form that allow the user to leave a comment for an article.

Parameters:

  • article – (mandatory) The name of the variable, where the article is stored at.
  • default – (optional) If not empty, a default formular with the mandatory fields will be generated.

Tag Content:

If default is not empty, the tag's content will be ignored and a default comment form will be generated. Otherwise you can define your own form content. These form fields are mandatory:

  • <input type="text" name="author_name" /> – The Name of the author.
  • <input type="text" name="author_mail" /> – The E-Mailaddress of the author(will never be published).
  • <textarea name="comment_text"></textarea> – The Text of the comment.
  • <input type="submit" name="post_comment" /> – Submit button (the name parameter is important).

Optionally, you can define this:

  • <input type="submit" name="preview_comment" /> – If this submit button was used, the comment will not be posted, but previewed

ste:page_prev and ste:page_next

These tags generate links to the previous (ste:page_prev) / next (ste:page_next) page of articles.

Parameters:

  • current – (mandatory) The current page number (see the page field of $current).
  • maxpage – (mandatory) How many pages in total (see the maxpage parameter of ste:articles_get)?
  • default – (optional) If empty, the tag's content will be used as the link's text, otherwise a default localized link text will be used.

ste:languages

Loops through all laguages available in the current context.

Parameters:

  • var – (mandatory) The name of the variable, where the current language information should be stored at.

Fields of var:

  • short – 2 letter code of language.
  • fullname – The full name of the language.
  • url – URL to the current page in this language.

ste:styles_load

Load all styles associated with the current section.

Parameters:

  • mode – (optional) Either "embed" or "link". Default: link

ste:title

Generate a title tag for the head section of your site that describes the currently viewed site.

The tag content should be the name of your site.link

Write a comment

Your name:

Your E-Mailaddress:

Your comment (Markdown format):

Markdown