{siteitem:seo_string:text}

Description

Looks up an item by its SEO-string name within the current site module and prints it. With one argument it prints the item fulltext; with a second argument that text is expanded in the found item context (so _#ALIAS field-getters resolve against that item). Resolution searches only the current (approved/active) items of the current site, matching the seo............. field, and uses the first match. An empty, missing, or unresolvable name returns an empty string; a present second argument that is empty also returns empty. This is the name-based counterpart to id-based item access: it lets templates pull a known content block (for example a config snippet stored as an item with a stable SEO name such as cfg-title or body-class-style) anywhere on the site without hardcoding an item id.

Parameters

seo_string required

The SEO-string name to look up. It is matched against the seo............. field of the current site modules approved items; the first matching item is used. Dashes are part of the name (for example about-us, cfg-title). An empty or unmatched name yields an empty result.

text optional default item fulltext

Optional template expanded in the context of the found item. When omitted entirely, the item fulltext is printed. When supplied, this text is expanded with the found item as the current item, so field-getters and field aliases resolve against it (for example a SEO-URL or headline field of the found item). Note: supplying an empty second argument prints an empty string, not the fulltext.

Examples

virtual<a href="{siteitem:clanky:_#SEO_URL_}">Articles</a>
ExpectedArticles
Articles">ActualArticles
Two-argument form used to read one field of a named item. _#SEO_URL_ resolves against the item whose SEO name is clanky, producing its friendly URL for a navigation link. Runtime-dependent on that item, so illustrative.
test[{siteitem:}]
Expected[]
Actual[]
An empty first argument short-circuits to an empty string before any lookup.
test[{siteitem:siteitem:}]
Expected[]
Actual[]
Trap: the item named siteitem resolves, but because a second argument is present and empty, the expanded text (empty) is printed - NOT the fulltext. Omit the second colon entirely to print the fulltext.
virtual{siteitem:about-us}
Expected(the fulltext of the item named about-us)
One argument: find the current sites item whose SEO name is about-us and print its fulltext. Runtime-dependent on that items existence and content, so shown as illustrative.
virtual<title>{siteitem:cfg-title}</title>
ExpectedMy Site
Actual
Common real-world pattern: store a small editable config block as an item with a stable SEO name (here cfg-title) and pull its fulltext anywhere on the site without hardcoding an item id. Runtime-dependent, so illustrative.
test[{siteitem:siteitem:FOUND}]
Expected[FOUND]
Actual[FOUND]
With a second argument, that text is expanded in the found items context. Here the item named siteitem exists (this very reference page), so the literal text FOUND is returned. If the name did not resolve, the result would be empty.
test[{siteitem:no-such-name}]
Expected[]
Actual[]
If no current item in the site matches the SEO name, the result is an empty string.