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
- Forum
- JCE Editor
- php tags being removed. (sorry, yes one more about this)
Support is currently Online
Official support hours:
Monday To Friday
From 09:00 To 17:00 Europe/London (BST)
From 09:00 To 17:00 Europe/London (BST)
i have jce 2.5.12 on joomla 3.4.8. validate html is set to 'no' on both editor config and the default profile. php = yes on default profie. yet <?php echo; ?> pasted into 'toggle editor' mode is converted to the <span class="mcePhp"><!-- echo --></span> thing when you switch to wysiwyg mode and back. i'm using the editor in a joomla article.
saving with no editor works fine (ie don't send me the link to the joomla changing things article).
saving with codemirror works fine too, but i would like to be able to edit everything but the php as wysiwyg.
(and yes, i realize i need another plugin to actually execute the php)
lots of places say if php = yes is on OR validate html = no, then the code won't be changed, but not for me.
ALSO, it's changing if ($x < 0) ... to 'if ($x > 0)'. wondering why jce can't leave the code alone if it's set to cleanup or validate = no. seems like i'm not the only one that wonders this perhaps.
saving with no editor works fine (ie don't send me the link to the joomla changing things article).
saving with codemirror works fine too, but i would like to be able to edit everything but the php as wysiwyg.
(and yes, i realize i need another plugin to actually execute the php)
lots of places say if php = yes is on OR validate html = no, then the code won't be changed, but not for me.
ALSO, it's changing if ($x < 0) ... to 'if ($x > 0)'. wondering why jce can't leave the code alone if it's set to cleanup or validate = no. seems like i'm not the only one that wonders this perhaps.
FYI - it is not possible to execute PHP code included in a Joomla article.
In order to do this, you need to use an extension like NoNumber Sourcerer - https://www.nonumber.nl/extensions/sourcerer
In this case, or if you want to display PHP code in an article as text (as a code example), then set Allow PHP to No.
When Allow PHP is set to Yes, the editor converts the PHP code to HTML (and back again on save) to protect the code from being processed as HTML.
In order to do this, you need to use an extension like NoNumber Sourcerer - https://www.nonumber.nl/extensions/sourcerer
In this case, or if you want to display PHP code in an article as text (as a code example), then set Allow PHP to No.
When Allow PHP is set to Yes, the editor converts the PHP code to HTML (and back again on save) to protect the code from being processed as HTML.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
thanks for answering, but i apparently i didn't explain my problem clearly.
yes, i know i need (and have) sorcerer or directphp etc. to execute php.
and no, i do not want to display php code in an article as text.
i am trying to include php code to be executed with sorcerer or directphp.
however jce keeps converting
and i have php set to 'on' and validate html set to 'off' and have read lots of articles and others having this issue, but can't jce to stop.
also, please know that joomla DOES NOT convert <?php if i use 'no editor' or 'codemirror' as my editor, so it's not joomla doing it, it is clearly jce converting it.
yes, i know i need (and have) sorcerer or directphp etc. to execute php.
and no, i do not want to display php code in an article as text.
i am trying to include php code to be executed with sorcerer or directphp.
however jce keeps converting
<?php
to
<span class="mcePhp"><!--
and converting
$x < 1
to
$x (ampersand lt 1
(spelled out so it won't be converted by the forum into a <)
and i have php set to 'on' and validate html set to 'off' and have read lots of articles and others having this issue, but can't jce to stop.
also, please know that joomla DOES NOT convert <?php if i use 'no editor' or 'codemirror' as my editor, so it's not joomla doing it, it is clearly jce converting it.
If you are using Sourcerer to insert PHP code, then it needs to be inserted in an encoded form, eg:
which can be done using the Sourcerer dialog.
In which case set Allow PHP in Editor Profiles -> Editor Parameters -> Advanced to No.
which can be done using the Sourcerer dialog.
In which case set Allow PHP in Editor Profiles -> Editor Parameters -> Advanced to No.
Just because you're not paranoid doesn't mean everybody isn't out to get you.
I am having the same problem - using JCE editor and Sourcerer. I've inserted the following using the Sourcerer code button:
{source}
<?php echo "test"; ?>
{/source}
And the above also displays on my page. I uploaded the file from your last post to /components/com_jce/editor/tiny_mce/plugins/code/, however there was no editor_plugin.js file to begin with. Uploading this file did not change anything.
JCE version 2.5.14
Validate HTML set to No in Global Configuration
Validate HTML set to No in Editor Profile - Editor Parameters - Cleanup & Output
Allow PHP set to No in Editor Profile - Editor Parameters - Advanced
{source}
<?php echo "test"; ?>
{/source}
And the above also displays on my page. I uploaded the file from your last post to /components/com_jce/editor/tiny_mce/plugins/code/, however there was no editor_plugin.js file to begin with. Uploading this file did not change anything.
JCE version 2.5.14
Validate HTML set to No in Global Configuration
Validate HTML set to No in Editor Profile - Editor Parameters - Cleanup & Output
Allow PHP set to No in Editor Profile - Editor Parameters - Advanced
- Page :
- 1
There are no replies made for this post yet.
Be one of the first to reply to this post!
Be one of the first to reply to this post!