Skip to content

En dev template special variables

semuel edited this page Dec 22, 2011 · 6 revisions

Template Special Variables

There are some predefined variables in Movable Type CMS screen templates, that can be used to inject code to various parts on the finished HTML. For using them, just append them you code, such as:

<mt:setvarblock name="var name" append="1">
... your code here ...
</mt:setvarblock>

Header variables

All these should be set before loading the header template. (cms/(include|dialog)/header.tmpl)

html_head

adds HTML to the head tag of the page. want to inject additional CSS file? this is the place

js_include

Use this one to add additional JavaScript scripts to the page. will be added to the head tag, after the loading of the jQuery library and MT’s own libraries

optimize_ui

Setting this to true will disable loading of jQuery.

html_body

inject some HTML to the very beginning of the document – right after the opening tag of ‘body’, and inside the main container div tag

form_header

inject HTML just above the form title

content_header

inject HTML just below the form title

Footer variables

related_content

form_footer

html_body_footer

open_dialog

if set to true, the page will open a dialog immediately on load. use the “dialog_mode” and “dialog_params” for setting which page will be loaded in the dialog box. the URL used will be:

script_url?__mode=<dialog_mode>&<dialog_params>

jq_js_include

The content of this variable will be added to a big JavaScript block in the bottom of the page, along with all MT’s jQuery code, wrapped inside a anonymous function scope. (but you don’t get to use jQuery as ‘$’)

Clone this wiki locally