In ModX, use longtitle if exists, else use pagetitle

In ModX, use longtitle if exists, else use pagetitle

0

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.

Posted in these interests:

modx
PRIMARY
0 subscribers
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