Rendering Custom Elements in the Editor

6 posts, 0 answers
  1. Guy
    Guy avatar
    49 posts
    Member since:
    Oct 2007

    Posted 06 Feb 2012 Link to this post

    We are currently rebuilding a module in one of our applications that takes a document template, replaces marked placeholders within the template with specific data , and then allows the user to download the file as a word document.

    The user would like to be able to edit these templates online, before they are rendered.  One key feature that we need to include is conditional blocks - certain sections of the template will only be rendered if the data in the system meets specific conditions.  We need to make these conditional blocks as user friendly to edit as possible.  

    What i have envisaged is creating a custom module for the RadEditor that can be used to select and insert conditional blocks, that the user can then edit to their liking.  It is important that the end user (who is non technical) can identify and understand these conditional sections easily and click on them to load them in the custom module editor.  

    I notice i can create custom content filters in javascript that can hook into the rendering of the designer/html view, which would seem appropriate for this kind of solution.

    The problem is that there is no documentation on the customFilter object - where can i find more info on how to use this?
  2. Richard
    Richard avatar
    479 posts
    Member since:
    Nov 2011

    Posted 08 Feb 2012 Link to this post


    Documentation on Content Filters contains a section on Implementing a Custom Filter with code.

    The online demo: Editor / Custom Content Filters provides some code and insights.

    Hope this helps!
  3. Guy
    Guy avatar
    49 posts
    Member since:
    Oct 2007

    Posted 08 Feb 2012 Link to this post


    What you have linked to is all that is available in the manual, and ive read through that already.

    There is no documentation for the API, which puts me at a dead end.

    Quite surprised that there is nothing documented.

    will raise a support ticket.
  4. Rumen
    Rumen avatar
    14392 posts

    Posted 09 Feb 2012 Link to this post


    For your convenience I wrote comments for the different methods used by the custom and built-in modules of RadEditor for ASP.NET AJAX:

    • MyFilter.initializeBase(this) - the initialization function of the module.
    • set_isDom(boolean) - specifies whether the filter will work with DOM objects or String, e.g. the boolean paramether specifies whether the content parameter of the getHtmlContent(content) and getDesignContent(content) functions will return DOM objects or String. The filter uses in the Custom Content Filters demo is of type string and converts the lowercase letters to uppercase.
    • set_enabled(boolean) - enable or disable the module depending on the boolean parameter
    • set_name(string) - specifies the name of the module
    • set_description(string) - specifies a more detailed description for the module
    • getDesignContent(content) - called when the editor is moving from some other mode to DESIGN mode
    • getHtmlContent(content) - called when the editor is moving from some other state to HTML mode 

    We will add this information to the help.

    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  5. Guy
    Guy avatar
    49 posts
    Member since:
    Oct 2007

    Posted 09 Feb 2012 Link to this post

    Thanks Rumen
  6. Philippe GRACA
    Philippe GRACA avatar
    35 posts
    Member since:
    Nov 2003

    Posted 29 Nov 2017 in reply to Guy Link to this post

    Hi Guy

    Have you been able to move forward with this project? 

    I'm also currently investigating a way to make some blocks in my html content hide/show depending on user data while merging.

    I've thought about a simple conditioning language like


    **END IF**

    but it would be nice to have this built in in the radeditor environment


Back to Top