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 9055057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:51:02+00:00 2026-06-16T13:51:02+00:00

I’m using CKEditor with refinerycms (rails CMS) I’ve also added basic support for radius

  • 0

I’m using CKEditor with refinerycms (rails CMS) I’ve also added basic support for radius tags (they are the tags used in Radiant, another rails CMS) so I’m able to list some elements from the model in the page just inserting a code.
The problem is that the radius tags mimic html:

<r:product_listing category="products" list_as="grid"/>

When using CKEditor to modify the page contents it thinks the radius tags are invalid HTML, which is correct and the expected behaviour, but I can’t find the way to tell CKEditor to just ignore those tags.

Any ideas?

Thanks in advance

EDIT: Turned out that the tag was being filtered by the sanitize method in rails being called by RefineryCMS.

  • 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-16T13:51:03+00:00Added an answer on June 16, 2026 at 1:51 pm

    What kind of issues do you have with custom tags? And on which browsers?

    I checked that CKEditor preserves this tag, but wraps entire content with it. To avoid that you have to edit CKEDITOR.dtd, namely:

    CKEDITOR.dtd.$empty[ 'r:product_listing' ] = 1;
    

    But that still may not be enough. To have better support you’d need to make more changes in this object – especially important is to define what can be its parents and that it’s an inline tag. For example:

    CKEDITOR.dtd.p[ 'r:product_listing' ] = 1; // it is allowed in <p> tag
    CKEDITOR.dtd.$inline[ 'r:product_listing' ] = 1;
    

    This still may not be enough – for example you’ll most likely won’t have copy&paste support.

    So, if you need more reliable support I’d try a little bit different way. Using CKEDITOR.dataProcessor you can transform this tag into some normal one when data are loaded into editor and when data are retrieved transform it back to that tag.

    Example solution:

    // We still need this, because this tag has to be parsed correctly.
    CKEDITOR.dtd.p[ 'r:product_listing' ] = 1;
    CKEDITOR.dtd.$inline[ 'r:product_listing' ] = 1;
    CKEDITOR.dtd.$empty[ 'r:product_listing' ] = 1;
    
    CKEDITOR.replace( 'editor1', {
        on: {
            instanceReady: function( evt ) {
                var editor = evt.editor;
    
                // Add filter for html->data transformation.
                editor.dataProcessor.dataFilter.addRules( {
                    elements: {
                        'r:product_listing': function( element ) {
                            // Span isn't self closing element - change that.
                            element.isEmpty = false;
                            // Save original element name in data-saved-name attribute.
                            element.attributes[ 'data-saved-name' ] = element.name;
                            // Change name to span.
                            element.name = 'span';
                            // Push zero width space, because empty span would be removed.
                            element.children.push( new CKEDITOR.htmlParser.text( '\u200b' ) );
                        }
                    }
                } );
    
                // Add filter for data->html transformation.
                editor.dataProcessor.htmlFilter.addRules( {
                    elements: {
                        span: function( element ) {
                            // Restore everything.
                            if ( element.attributes[ 'data-saved-name' ] ) {
                                element.isEmpty = true;
                                element.children = [];
                                element.name = element.attributes[ 'data-saved-name' ];
                                delete element.attributes[ 'data-saved-name' ]
                            }
                        }
                    }
                } );
            }
        }
    } );
    

    Now r:product_listing element will be transformed into span with zero-width space inside. Inside editor there will be a normal span, but in source mode and in data got by editor#getData() method you’ll see original r:product_listing tag.

    I think that this solution should be the safest one. E.g. copy and pasting works.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I used javascript for loading a picture on my website depending on which small
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.