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
An introduction to STE – Ratatöskr

Ratatöskr

An introduction to STE

Here I will explain you the basics of STE, the template engine, that Ratatöskr uses.

If you already know HTML (you should, if you plan to write your own temlates), this should not be that difficult.

Basically, STE adds variables and special tags to HTML, although STE does not really understand HTML itself. We will discuss this in the section about tags.

Variables

A variable is a construct, that will be replaced by a text at the time, the template will be executed by STE. Imagine it as a placeholder.

A variable is either prefixed by a $ sign, or is enclosed in ${ and }. So this $foo is equivalent to ${foo}. The later form is useful if you want to write something like this: ${foo}ish. If you wolud use the first form ($fooish) this would beinterpreted as a single variable called fooish and not as a variable named foo plus the text ish.

Variable names can contain numbers, letters (lower and upper case) and underscores (_).

If you need a literal $ sign, you can write \$.

Variables can also have sub-variables. This is called an array. If you want to access the array field bar of the variable foo you would write this: $foo[bar] or ${foo[bar]}. The array field baz of this construct would then be: $foo[bar][baz].

Tags

STE's tags look almost like regular HTML tags. Tags are also replaced by some text but are more powerful than variables since they can have parameters and can have text, variables and other tags as sub-elements. Here is a tag called foo with the parameter bar set to baz and containing some text:

<ste:foo bar="baz">
    some text
</ste:foo>

As you can see, tags can come in an opening (<ste:foo bar="baz">) and a closing (</ste:foo>) version and their names are always prefixed with ste:. Parameter values can also be enclosed in single quotes instead of double quotes: (<ste:foo bar='baz'>). Self-closing tags are also allowed:

<ste:another_tag test="test" />

Allowed tag names can have numbers, letters (upper and lower case) and underscores. The same rules apply to parameters.

You can mix STE tags in HTML at every position, so this is allowed (and that explains why I said, that STE does not understand HTML):

<img src="<ste:get_cool_image />" alt="test" />

Tag parameter values can contain variables, but can not contain other STE tags.

If you need a literal " in a tag parameter, write \" instead.

Comments and raw text:

If you want to write a comment, you can use the pseudo-tag <ste:comment>. It's content will be ignored completely.

If you want a large passage of raw text, that might include text that STE would interpret, but should not, you can use the <ste:rawtext> pseudotag. Everything within this will be written out without processing it at all.

Builtin tags and the standard library

Now you know, how this system works, but it is not really useful yet.

Before I will show you Ratatöskr's specific tags for articles, comments and more, you should read about the tags, that STE already uses, since you will need at least some of these.

Using STE with Ratatöskr

Variables and tags used by Ratatöskr

Write a comment

Your name:

Your E-Mailaddress:

Your comment (Markdown format):

Markdown