Knowledge for the World
In ModX, use longtitle if exists, else use pagetitle

In ModX, use longtitle if exists, else use pagetitle

This guide demonstrates how to use ModX conditional statements and template tags to check for and display a resource's Long Title. If it exists, the Long Title is printed; if it does not exist, the regular page title is printed.

1

Use the following conditional statement

[[*longtitle:notempty=`[[*longtitle]]`:default=`[[*pagetitle]]`]]

The code above can be roughly interpreted as: IF longtitle !EMPTY, PRINT; ELSE, PRINT pagetitle