MODX Base HREF

Sharing is Caring

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.

Author: Brian Cline

Brian is a programmer living in Niagara Falls with ten years of development experience. He is passionate about automation, business process re-engineering, and gamification. For the last six years or so, he has been working with Salesforce and JavaScript.

Related Posts

Sharing is Caring