Can you add raw php code in the template?? Topic is solved

General project discussion. NOT for help questions.
Post Reply
netfast

Can you add raw php code in the template??

Post by netfast »

Is it possible to run raw php code inside the template? I know how I can do it with php so can I do it with CMSMS?

ie. I need to display a different header for each page and dont want do do this inside the content
Piratos

Re: Can you add raw php code in the template??

Post by Piratos »

you can use php in templates only with include

example  {include_php file="/pfad/zu/lade_nav.php"}
nordjohn

Re: Can you add raw php code in the template??

Post by nordjohn »

it doesn't work...where could I made a mistake...?
thanks!
---
johntvery@yahoo.com
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: Can you add raw php code in the template??

Post by calguy1000 »

set 'use_smarty_php_tags' to true in the config.php

and then {php}phpinfo();{/php} will work the way you want it to.

Or you could put your php code into a user defined tag, like:   

Code: Select all

echo "My Name is Bob";
and then call it with {tag_name} in your code.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “General Discussion”