You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

#109507 Cannot get PHP code to display correctly using Joomla 4

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Wednesday, 08 March 2023 10:01 GMT

Romuba
I'm building a site using Joomla 4
I have JCE Editor 2.9.17

I want to add some PHP into a footer block but it displays the code instead of the output.

I have turned PHP on under Editor parameters>Advanced

Ryan
Are you using Regular Labs Sourcerer - https://regularlabs.com/sourcerer - or DirectPHP - https://extensions.joomla.org/extension/directphp/ - to process the PHP content?

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Romuba
I tried using both of those but still the code didn't display. I am doing this through NicePage and suspect that the problem might be there and have raised a ticket with them.

Erik66
Having the same issue. JCE 2.3.33 as well as 2.34.rc1. J! 4.2.6, with both templates Casiopeia as and Helix Ultimate.

Ryan
PHP code cannot be executed in article content, it can only be displayed as code, which is what JCE allows for.

To execute PHP code in an article, you need to use an extension like RegularLabs Sourcerer - https://regularlabs.com/sourcerer - or DirectPHP - https://extensions.joomla.org/extension/directphp

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.