Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8909445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:25:58+00:00 2026-06-15T03:25:58+00:00

I’m using Ckeditor version 3.1 within CakePHP 2.x I can get the editor to

  • 0

I’m using Ckeditor version 3.1 within CakePHP 2.x

I can get the editor to load and replace the textarea. The HTML is saved to the database with HTML formatting tags like this:

<p>
<strong>&lt;p&gt; This is a test&lt;/p&gt; </strong></p>

When I insert that into the CkEditor I get the following appearing in the editor screen:

<p> <strong>&lt;p&gt; This is a test&lt;/p&gt; </strong></p>

If I use html_entity_decode prior to setting up the CkEditor I get this in the editor screen:

<p> <strong><p> This is a test</p> </strong></p>

This is how I am loading the editor in the edit.ctp Cake view:

$bio = $this->data['Club']['bio'];  
echo $this->Cksource->ckeditor('Club.bio', array('value'=>$bio) );

How can I force CkEditor to parse the incoming HTML so that it is formatted and not displaying the HTML tags?

Edit:
I have manually overwritten the Cake Helper so that the Javascript being output looks like this:

CKEDITOR.replace('data[Club][bio]',
                    {
                        entities: false,
                        basicEntities: false,
                        entities_greek: false,
                        entities_latin: false,
                        htmlDecodeOutput: true
                    }
                );

The appropriate form field is being converted to a ckeditor instance so the first parameter is correct, I assume. I’ve also tried to update config.js without any luck.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:25:59+00:00Added an answer on June 15, 2026 at 3:25 am

    Thanks Harry – you helped with the setup. I had to tweak the Cake stuff to get the Javascript looking like you said it should.

    Anyway here’s something that is working for me:

    $bio = $this->data['Club']['bio'];  
    $bio = html_entity_decode($bio);
    $bio = preg_replace( '/\s+/', ' ', $bio );
    
    $events['instanceReady'] = "function (ev) {
                console.log(ev.editor);
                ev.editor.setData( '$bio' );
            }";
    
    echo $this->Cksource->ckeditor('Club.bio', array(
                        'value'=>$bio, 
                        'config'=>array(
                            'entities'=>false,
                            'basicEntities'=>false,
                            'entities_greek'=>false,
                            'entities_latin'=>false, 
                                'htmlDecodeOutput'=>false), 
                        'events'=>$events
                        ) 
                    );
    

    I would imagine it is not really necessary to put the value in when echoing out the editor.

    I kept getting a Javascript error when trying to setData (“unexpected ILLEGAL tag”) which is why I strip out excess whitespace – which fixes that issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.