Skip to content
This repository was archived by the owner on Nov 12, 2023. It is now read-only.

TemplateVars

Mic edited this page Oct 10, 2015 · 1 revision

Template vars let you define in any custom template file a value to be set in a base template file (a page about those definition of template files will be added to the wiki).

php files

You can use template vars in included php files, setting them in any of your site's files with the function:

set_template_var('title','My very nice title!');

and then, in any base template file (filename starting with evn__), you can output the var with the function:

get_template_var('title');

Check the evn_site/_pages/a_file.php to see a live example of it.

html files

You can use template vars in included html files, setting them in any of your site's files with the tags:

<evn:vars></evn:vars>

Inside those tags you can define one var per line, like this

title=My very nice title!

Then, in any base template file (filename starting with evn__), you can output the var with the function:

get_template_var('title');

Check the evn_site/_pages/an_html_file.php to see a live example of it.

Clone this wiki locally