Page 1 of 1

Insertion of php code in html code of an article

Posted: Fri Jan 27, 2012 5:05 pm
by pfaniel
Hello

This is the first time I post a question in a forum. So I am still in its infancy. Also, I'm not a crack of Joomla!, PHP and many others.

I am looking for how to insert a php function in the html code of Joomla article.

A concrete example of my problem: When I insert <p><?php echo "This is a test";?></p> in the html code of an article, the string changes into
<p>
<!--?php echo "This is a test";?--></p>

In other words, the editor changes the php statement into an html comment.

Is there a way to solve this problem? If so, I would most appreciate a help for it ?

Thank you in advance for the help

Pierre Faniel

Re: Insertion of php code in html code of an article

Posted: Fri Jan 27, 2012 5:24 pm
by jhcorsair
Use the JCE Editor: http://www.joomlacontenteditor.net/
Besides a whole bunch of functionality, you can configure it to allow code.

joomlawebsitesbyjim.com

Re: Insertion of php code in html code of an article

Posted: Thu Mar 08, 2012 11:41 pm
by luis23045
This is what I normally do to insert not too complex PHP code inside the articles.

First install this extension: http://extensions.joomla.org/extensions ... ntent/4470

Then Enable it inside the Plugin Manager.

If you click inside the Plugin you can go to Parameters and set everything like I do on the Picture 1 below.

Then finally I disable the Editor TinyMCE inside the Global Configurations and I use the Articles without any Editor at all.

I work in plain code display.

Finally after all that I start pasting whatever needed PHP Code.