If this is your first visit, check our documentation. To post, register or login.

Ckeditor change my php code

Started by rampino on 8 May 2013, 1:23 PM · Views: 1,655

Results 1 to 9 of 9
8 May 2013, 1:23 PM
#1
rampino avatar

rampino

New Zenner

Join Date:
May 2013
Location:
Florence (Italy)
Posts:
5
Plugin Contributions:
1

Post #1 by rampino

Hello,

I added the CKEditor module v. 3.6.6 rel.7689 (I think 3.7E!?)

The problem:
When I published a page with code like the following

*…<div align="center">
<a href="<?php echo zen_href_link(FILENAME_DEFAULT, 'cPath=104') ?> ">
<img alt="MyImage" border="0" height="140" hspace="0" src="images/myimage.png" width="140" />
</a>

</div> …*

After saving the edited page, the program (ckeditor) replaces the whole as follows:

*…<div align="center">
<a href="**<http://www.my-site.com/admin/%3C>**?php echo zen_href_link(FILENAME_DEFAULT, 'cPath=104') ?>">
<img alt=" MyImage " border="0" height="140" hspace="0" src="images/myimage.png" width="140" />
</a>

</div> …*

with obvious error link!
someone is able to solve this "defect" ?

thanks

8 May 2013, 11:00 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #2 by kobra

What type of page are you editing???

If an ezpage - they do not parse php code

Actually, any page besides a define page - i.e. product description, etc... do not parse php code

Zen-Venom Get Bitten

9 May 2013, 11:17 AM
#3
rampino avatar

rampino

New Zenner

Join Date:
May 2013
Location:
Florence (Italy)
Posts:
5
Plugin Contributions:
1

Post #3 by rampino

In some "Define Pages" I need to make links like the one shown in the previous example.
I do not understand why ckeditor change the link code?

I need to make sure that ckeditor does not automatically change my link code!

How can I do?

Or, does anyone know another syntax to use the function "zen_href_link" in "define Page"?
Thank you for your attention

9 May 2013, 3:25 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #4 by kobra

n some "Define Pages" I need to make links like the one shown in the previous example
Enter code ONLY when in text ("source") mode in the editor

Zen-Venom Get Bitten

9 May 2013, 4:59 PM
#5
rampino avatar

rampino

New Zenner

Join Date:
May 2013
Location:
Florence (Italy)
Posts:
5
Plugin Contributions:
1

Post #5 by rampino

hi Kobra,
I did not understand your answer
could you, please, explain with other words (or examples)

What am I doing wrong?
thanks

9 May 2013, 5:38 PM
#6
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Post #6 by divavocals

Rampino:

hi Kobra,
I did not understand your answer
could you, please, explain with other words (or examples)

What am I doing wrong?
thanks
there is a "Source" or "View Source" icon on the CKEDITOR toolbar.. click THAT icon and paste your code there.. You cannot put your code into the WYSIWYG editiors..

Your alternative is to chose the default editor from the editor pulldown BEFORE you edit your defined page so you are using the default text editor and NOT CKEditor..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

9 May 2013, 5:48 PM
#7
rampino avatar

rampino

New Zenner

Join Date:
May 2013
Location:
Florence (Italy)
Posts:
5
Plugin Contributions:
1

Post #7 by rampino

I would like to point out that:
even without making changes, just the simple SAVE a "define_page" with the editor "CKEditor", to get the replacement string ("<? php) with the string (http://www.my-site/admin /% 3C? php)

9 May 2013, 5:54 PM
#8
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Post #8 by divavocals

Rampino:

I would like to point out that:
even without making changes, just the simple SAVE a "define_page" with the editor "CKEditor", to get the replacement string ("<? php) with the string (http://www.my-site/admin /% 3C? php)
We know.. which is why we posted the advice we posted..

Because you can't use the WYSIWYG editor when you include PHP code.. that includes creating or editing or even doing NOTHING and saving..

you can't use the WYSIWYG editor when you include PHP code!!

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

9 May 2013, 6:16 PM
#9
rampino avatar

rampino

New Zenner

Join Date:
May 2013
Location:
Florence (Italy)
Posts:
5
Plugin Contributions:
1

Post #9 by rampino

DivaVocals:


you can't use the WYSIWYG editor when you include PHP code!!

thanks

so it is clear for all