0
votes

I'm relatively new to Joomla and this is driving me crazy.

I need to use PHP code in some articles (3 of them exactly) in Joomla 2.5. I use the DirectPHP plug-in which seems to be working fine, BUT the TinyMCE editor gets in the way and automatically comments the PHP code out when I save the page.

I can of course disable TinyMCE entirely, and then everything works as intended, but I need to keep it enabled because other users need it (for editing other articles).

I checked in the TinyMCE plug-in options, but there's no option to disable code cleanup or anything like that.

I checked in the "Text Filters" page of Joomla (in Global Configuration) but this doesn't seem to help: "Administrator" (which is the type of my account) already says "No filtering", so that's not it.

I also tried to change the permissions for one of the articles I need PHP on, basically denying editing rights to every groups except "Administrator" and "Super User" (who both have the "No filtering" setting enabled in Text Filters). No luck either.

So I'm stuck.

Basically what I need would be to have TinyMCE disabled for those 3 articles only. Is that possible?

If not, what would be the best way of solving this problem?

1

1 Answers

1
votes

Rather than using DirectPHP, I would highly recommend using Sourcerer. It has a very high rating, great support and is regularly maintained. It's the same sort of concept as DirectPHP but allows you to add other languages to your articles such as Javascript and CSS.

Here is a small example of how it works. Simple add the code to your article once you have enabled the plugin:

{source}
<?php
    echo 'Hellow World';
?>
{/source}