Rendering/Parsing Mura Tags - Mura Docs v6

Rendering/Parsing Mura Tags

Since parsing Mura tags means that content managers are able to enter dynamic code within form fields (e.g, Content and Summary areas), it's important that you understand how to control this behavior.

settings.ini.cfm

In the file located at /config/settings.ini.cfm is a global setting that allows you to enable or disable the rendering of Mura tags. It defaults to true.

enablemuratag=true;

You can also explicitly disable or enable the Mura tag on a site-by-site basis, by adding this.enableMuraTag={true | false} to the Site's contentRenderer.cfc or the theme's eventHandler.cfc:onRenderStart() method, you could add
$.getContentRenderer().enableMuraTag={true | false}

$.setDynamicContent()

Mura also has a special helper method called $.setDynamicContent() to wrap around CFML variables and/or function calls to evaluate any string that may contain Mura tags. 

For example, if you were to simply output the Content body of any particular content node that contains Mura tags, they would not render. Let's assume you had entered the following into your Content body area:

<p>Hello, today is [mura]Now()[/mura]</p>

In your CFML template, you might have something like this:

#$.content('body')#

When this code ends up at the CFML server, it has no idea that those Mura tags are supposed to be evaluated, so it would simply output what you entered:

<p>Hello, today is [mura]Now()[/mura]</p>

All you need to do is wrap the helper method around the output on your CFML template:

#$.setDynamicContent($.content('body'))#

Would output:

<p>Hello, today is {ts '2013-11-07 14:14:44'}</p>

Tip: This method is actually what happens under the hood when using $.dspBody() to output the Content body.

So, just to review, only use Mura tags in form fields within Mura CMS. Mura will then simply replace the Mura tags with number/hash signs for you.