[solved]I would like to post PHP Code but Smarty tries to process it as a tag.

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.
Post Reply
JRSofty
New Member
New Member
Posts: 6
Joined: Wed Jun 03, 2009 7:58 am

[solved]I would like to post PHP Code but Smarty tries to process it as a tag.

Post by JRSofty »

Is there a way to post PHP code in my pages without the template system from trying to process it as a Smarty tag?
Last edited by JRSofty on Fri Jun 05, 2009 8:24 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: I would like to post PHP Code but Smarty tries to process it as a tag.

Post by RonnyK »

wrap it between ...

Ronny
Ziggywigged
Power Poster
Power Poster
Posts: 424
Joined: Sat Feb 02, 2008 12:42 am

Re: I would like to post PHP Code but Smarty tries to process it as a tag.

Post by Ziggywigged »

Add it as a User Defined Tags from under the Extensions menu in the admin.
See also: http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Extensions/User_Defined_Tags
Take a penny, leave a penny.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: I would like to post PHP Code but Smarty tries to process it as a tag.

Post by RonnyK »

OK... 2 answers for 2 different questions...

Are you trying to SHOW the php, then you can use my post.... If you want to execute PHP in the page, then you should use the second logic, using the UDT...

Ronny
JRSofty
New Member
New Member
Posts: 6
Joined: Wed Jun 03, 2009 7:58 am

Re: I would like to post PHP Code but Smarty tries to process it as a tag.

Post by JRSofty »

Thanks Ronnie that was what I was looking for to show the PHP.
JRSofty
New Member
New Member
Posts: 6
Joined: Wed Jun 03, 2009 7:58 am

Re: I would like to post PHP Code but Smarty tries to process it as a tag.

Post by JRSofty »

Sadly wrapping it in tags didn't seem to work. I'm getting errors in the item when it is displayed. I keep getting these "unrecognized tag" errors.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: I would like to post PHP Code but Smarty tries to process it as a tag.

Post by RonnyK »

OK,

then put {literal} {/literal} around it....

Ronny
JRSofty
New Member
New Member
Posts: 6
Joined: Wed Jun 03, 2009 7:58 am

Re: I would like to post PHP Code but Smarty tries to process it as a tag.

Post by JRSofty »

That's got it thanks..
Post Reply

Return to “CMSMS Core”