Tag: site_url

MODX Base HREF

There’s a lot of sites incorrectly showing how to use site_url in both MODx Evolution and MODx Revolution. Primarily, I use site_url with the html base tag. If you don’t already know the base tag goes inside head and specifies the default address.

In MODX Revolution, our code in a template would look like:

<head>
<title>Some Revolution Page</title>
<base href="[[++site_url]]" </>
</head>

In MODX Evolution, our code in a template would look like:

<head>
<title>Some Evolution Page</title>
<base href="[(site_url)]" </>
</head>

Hope this helps.