NYCPHP Meetup

NYPHP.org

[joomla] Embed PHP in Joomla's HTML?

bz-gmort at beezifies.com bz-gmort at beezifies.com
Sun Aug 26 06:15:56 EDT 2007


David A. Roth wrote:
> Q: Should I be forced to write a module and include the whole article 
> inside the module just to do the PHP?
>

By default, Joomla is not going to run PHP code embedded in articles.  
Remember the security structure is based on the magazine format of security.

IE you have readers, authors, and editors
And then you have managers, admins, and the super admin

Your authors and editors are trusted to write articles not code.  If you 
let them write code, they could really muck up the system.

So in answer to the first question, yes you should be forced to write a 
module or do something else deliberately to bypoass this security.
> Q: Is there a more clever Joomla-like way to accomplish this in the 
> manner similar to how mosimage (jpgs) are inserted into the body of 
> text, but executed a PHP script?
>

Well, a clever way to avoid writing module after module just for small 
tasks is to use Jumi.
http://www.vedeme.cz/index.php?option=com_content&task=category&sectionid=10&id=41&Itemid=123

Jumi is a swiss army knife of a module, where you can embed various bits 
and pieces of code to make numerous custom modules using Jumi.

Alternatively, if you want to place it in the content, than use a PHP 
running mambot.

Lastly, if you want to place it on every page in a specific spot, you 
can edit the index.php file for your template and place your code there.




More information about the Joomla mailing list