Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Posts
    134
    Plugin Contributions
    0

    Default CKEditor corrupts code

    If I use CKEditor to edit pages in the 'Define Pages' section something puzzling occurs.

    For example, in one page I have this code
    Code:
    <?php
    if ($this_is_home_page) {
    ?>
     <?php
        if (RAP_SLIDES_STATUS == 'true') {
    ?>
          <?php require($template->get_template_dir('tpl_home_slider.php',DIR_WS_TEMPLATE, $current_page_base,'common')
    		    . '/tpl_home_slider.php');?>
    <?php
        } ?>
    <?php
        } ?>
    And that is how it appears if I use the 'Plain text' editor.
    The page will appear with a slide show on it.

    However if I then open the same page using CKEditor the page content is shown as
    Code:
    get_template_dir('tpl_home_slider.php',DIR_WS_TEMPLATE, $current_page_base,'common') . '/tpl_home_slider.php');?>
    and the source now looks like this
    Code:
    <!--?php
    if ($this_is_home_page) {
    ?--><!--?php
        if (RAP_SLIDES_STATUS == 'true') {
    ?--><!--?php require($template--->
    <p>get_template_dir(&#39;tpl_home_slider.php&#39;,DIR_WS_TEMPLATE, $current_page_base,&#39;common&#39;) . &#39;/tpl_home_slider.php&#39;);?&gt; <!--?php
        } ?--> <!--?php
        } ?--></p>
    This happens on two different sites so I wonder if anyone has any idea what is happening here.

  2. #2
    Join Date
    Jul 2009
    Location
    picaflor-azul.com
    Posts
    6,928
    Plugin Contributions
    45

    Default Re: CKEditor corrupts code

    Quote Originally Posted by pewe View Post
    If I use CKEditor to edit pages in the 'Define Pages' section something puzzling occurs.

    For example, in one page I have this code
    Code:
    <?php
    if ($this_is_home_page) {
    ?>
     <?php
        if (RAP_SLIDES_STATUS == 'true') {
    ?>
          <?php require($template->get_template_dir('tpl_home_slider.php',DIR_WS_TEMPLATE, $current_page_base,'common')
    		    . '/tpl_home_slider.php');?>
    <?php
        } ?>
    <?php
        } ?>
    And that is how it appears if I use the 'Plain text' editor.
    The page will appear with a slide show on it.

    However if I then open the same page using CKEditor the page content is shown as
    Code:
    get_template_dir('tpl_home_slider.php',DIR_WS_TEMPLATE, $current_page_base,'common') . '/tpl_home_slider.php');?>
    and the source now looks like this
    Code:
    <!--?php
    if ($this_is_home_page) {
    ?--><!--?php
        if (RAP_SLIDES_STATUS == 'true') {
    ?--><!--?php require($template--->
    <p>get_template_dir('tpl_home_slider.php',DIR_WS_TEMPLATE, $current_page_base,'common') . '/tpl_home_slider.php');?> <!--?php
        } ?--> <!--?php
        } ?--></p>
    This happens on two different sites so I wonder if anyone has any idea what is happening here.

    You must use a plain text to edit this file since it contains php code. A html or wysiwyg editor will corrupt the php code.

    Thanks,

    Anne

  3. #3
    Join Date
    Aug 2006
    Posts
    134
    Plugin Contributions
    0

    Default Re: CKEditor corrupts code

    Thanks Anne.

    As you probably figured it was a main page in one of your templates I was trying to alter - so for that I guess I'll have to create it elsewhere and past the code using the Plain Text editor.

 

 

Similar Threads

  1. v150 Products table corrupts repeatedly
    By apollowilcox in forum General Questions
    Replies: 1
    Last Post: 3 Sep 2014, 09:16 PM
  2. v139h iframe corrupts Zen pages ??
    By kevinmc3 in forum General Questions
    Replies: 4
    Last Post: 11 Apr 2014, 09:18 PM
  3. v151 Ckeditor change my php code
    By Rampino in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 9 May 2013, 07:16 PM
  4. define pages editor corrupts files
    By Aa12345 in forum General Questions
    Replies: 1
    Last Post: 13 Jan 2011, 07:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg