Skip to content
  1. Extras
  2. pdoTools
  3. Snippets
  4. pdoTitle

pdoTitle

Snippet outputs a formatted title tag: page name, parent names and other params.

Main use: visual distinction of documents with pagination.

Parameters

Snippet does not accept general pdoTools params due to its role. It passes all params to nested pdoCrumbs call.

ParameterDefaultDescription
&id0Resource ID.
&limit3Max parents to include.
&titleFieldlongtitleResource field for page title.
&cacheCache parent selection.
&cacheTime0Cache TTL in seconds.
&tplPages@INLINE ...Chunk for pagination in title.
&pageVarKeypageURL param for page number.
&tplSearch@INLINE ...Chunk for search query in title.
&queryVarKeyqueryURL param for search query.
&minQuery3Min search query length to show.
&outputSeparator/Separator between title parts.
&registerJs1Output JS vars for pdoPage &ajaxMode.

Pagination support

When &pageVarKey is in URL, pdoTitle adds pagination to title.

Works with pdoPage &ajaxMode — title updates without reload.

Search support

When &queryVarKey is in URL, snippet inserts chunk &tplSearch for the search query.

Default placeholder: [[+mse2_query]] from mSearch2.

Caching

Call pdoTitle uncached so it can react to URL params. You can cache the internal parent selection (via pdoCrumbs) for weak hosting.

Javascript variables

With &registerJs enabled, snippet outputs vars in pdoTitle object: separator and pagination chunk.

Examples

Default call:

modx
<title>[[!pdoTitle]] / [[++site_name]]</title>

More parents and caching:

modx
<title>[[!pdoTitle?limit=`5`&cache=`1`]] / [[++site_name]]</title>