{sitespot:spot_id}

Description

Returns the rendered HTML of a Site module spot - a named page-fragment (header, footer, sidebar, body block) - identified by its numeric spot ID, within the current site. The spot content is expanded through the template engine before it is returned. Output is produced only while a Site module page is being rendered, where the current site is known; on a plain view or slice render the site is not set and sitespot returns an empty string. The spot ID must be all digits: a non-numeric or empty ID yields an empty string and never errors. Spot 1 is the site root (start) spot. Use sitespot to reuse one shared spot inside another spot or inside item content.

Parameters

spot_id required default (none)

Numeric ID of the Site module spot to render. Must be all digits; spot 1 is the site root (start) spot. A non-numeric or empty value returns nothing.

Examples

virtual{sitespot:1}
Expected(HTML of the site root spot - shown only inside a Site page render)
Returns the rendered HTML of spot 1, the site root (start) spot of the current site. Output is produced only while a Site module page is being rendered; on a plain view or slice render the site is unknown and the result is empty.
virtual{sitespot:7}
Expected(HTML of spot 7 - shown only inside a Site page render)
Pulls a shared page-fragment (here spot 7, e.g. a common footer) into the current output. Useful for reusing a header, footer, or sidebar spot in another spot or in item content. Replace 7 with the numeric id of the spot you want.
test[{sitespot:}]
Expected[]
Actual[]
With no spot id, or when there is no current site (a plain view or slice render rather than a Site page), sitespot returns nothing. This is why the same expression can render a footer on the public site yet produce empty output when tested on its own.
test[{sitespot:header}]
Expected[]
Actual[]
The spot id must be all digits. A non-numeric id (or a value that happens to be a field name or word) fails the digit check and yields an empty string - it never errors.