FirstChildRedirect

This is a user-contributed Extra. If you find issues or would like more info or help, please contact the author.

This snippet redirects to the first child document of a folder in which this snippet is included within the content (e.g. [!FirstChildRedirect!]).

This allows Evo folders to emulate the behavior of real folders since Evo usually treats folders as actual documents with their own content.

Modified to make Doc ID a required parameter… now defaults to the current Page / Folder you call the snippet from.

Parameters

Parameter Description Default
&docid=`12`

Use the docid parameter to have this snippet redirect to the first child document of the specified document

optional; default: current document
&default=`1`
or
&default=`site_start`

Use the default parameter to have this snippet redirect to thedocument specified in cases where there is no children.

It can be a document ID or one of: site_start, site_unavailable_page, error_page, unauthorized_page

optional; default: site_start
&sortBy=`menuindex`

Get the first child depending on this sort order

Can be any valid Evo document field name

optional; default: menuindex
&sortDir=`DESC`

Sort "ASC" for ascending or "DESC" for descending

optional; default: ASC
&responseCode=`301`

Can be "301", "302" or the complete response code, eg "HTTP/1.1 302 Moved Temporarily"

The responsecode (statuscode) to use for sending the redirect.

optional; default: 301

Suggest an edit to this page.