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.

Sharing is Caring

Brian is a programmer and technology leader living in Niagara Falls with more than ten years of development experience. He is passionate about automation, business process re-engineering, and building a better tomorrow.

Brian is a proud father of four: two boys, and two girls and has been happily married to Crystal for more than ten years. From time to time, Brian may post about his faith, his family, and definitely about technology.