Using PHP in templates

You can use PHP in both page- and content Templates using {php} Smarty tag:

{php}
insert you php script here
{/php}

Because of security reasons you will get an error message "PHP-tags and functions within templates are not allowed in this site" when trying to save templates which contain PHP code or similar symbols.

Please go to your website root directory, find file named config.php and change the following line there:

# Allow PHP-tags in Smarty templates
allow_php_tags=1

If you installed the CMS using FTP, the config.php file in /editor and /admin folders are probably not linked to the one in the site root. So go and change the setting there as well.

We strongly suggest to modify the setting back to zero when finishing with site development.

Site development

About Saurus API / Creating page template tutorial / Creating content template tutorial / Applying custom design to page template checklist / Site and Article editor CSS styles / Using PHP in templates / Profiles and Custom Assets / Site languages / Printer friendly pages / Site cache / Page compression / Enabling browser cache / Creating WAP pages / Configuring sitemap / Saurus 4.1 technical notes