Embedding PHP into template?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
ahmednuaman

Embedding PHP into template?

Post by ahmednuaman »

Now we all know about the problems with different browsers and CSS. Normally, I'd use PHP to overcome these issues by having browser specific CSS. In CMSMS, how can I embedded custom PHP into the master template? I tried adding a little PHP string into the main template on my site via the admin, but it wasn't parsed as PHP.
Zoorlat

Re: Embedding PHP into template?

Post by Zoorlat »

ahmednuaman,

Use a smarty-tag. Put your code directly between {php} and {/php}.

Also, in config.php, make sure the parameter $config['use_smarty_php_tags'] is set to 'true'

If you want to reuse your script in more places, consider creating a user defined tag (http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Extensions/User_Defined_Tags)
ahmednuaman

Re: Embedding PHP into template?

Post by ahmednuaman »

Fantastic! Thanks for that!
Locked

Return to “CMSMS Core”