This is a migrated thread and some comments may be shown as answers.

Rendering Custom Elements in the Editor

5 Answers 92 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Guy
Top achievements
Rank 1
Guy asked on 06 Feb 2012, 03:37 PM
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?

5 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 08 Feb 2012, 05:15 PM
Guy:

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!
0
Guy
Top achievements
Rank 1
answered on 08 Feb 2012, 05:26 PM
Hi,

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.
0
Rumen
Telerik team
answered on 09 Feb 2012, 09:05 AM
Hello,

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.



Regards,
Rumen
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Guy
Top achievements
Rank 1
answered on 09 Feb 2012, 10:35 AM
Thanks Rumen
0
Philippe GRACA
Top achievements
Rank 1
answered on 29 Nov 2017, 11:13 AM

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

** IF CONDITION**

**END IF**

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

Thanks

Tags
Editor
Asked by
Guy
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Guy
Top achievements
Rank 1
Rumen
Telerik team
Philippe GRACA
Top achievements
Rank 1
Share this question
or