How to add php code into a page?

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
ellaissad
Forum Members
Forum Members
Posts: 48
Joined: Wed Jul 11, 2007 6:41 pm

How to add php code into a page?

Post by ellaissad »

Stupid question..

I need to add the google stats php include code into my pages. But when I try to add this via "html" mode in the editor, it seems to erase my code everytime.

   
   


Where can I put php code into a page without modifying the template?

Thanks!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: How to add php code into a page?

Post by calguy1000 »

This question is an FAQ and has been answered dozens of times on this forum, and I believe it's also answered in the wiki.
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.
streever

Re: How to add php code into a page?

Post by streever »

I might be wrong calguy, I think his problem is most of the forum tells you how to add it to Template: but he looks like he needs to add it to PAGES.

If you CAN access the template, PLEASE put it there--it will make your life more easy. Otherwise, you should create a UDT (user defined tag) as is outlined elsewhere in the forums.

Simply create a udt called (whatever) and paste in your google code. Then, you call the tag by typing, {thename} into your pages--whatever you called it, surrounded by {}.

i hope that helps.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: How to add php code into a page?

Post by calguy1000 »

The same methods for adding php code to templates (either via a udt, or using {php} and {/php} ) will work in a content block.
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.
streever

Re: How to add php code into a page?

Post by streever »

yea, I think he just can't access templates? would help if he'd post back and let everyone know
Post Reply

Return to “CMSMS Core”