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

Editor Customization

1 Answer 15 Views
This is a migrated thread and some comments may be shown as answers.
Yogesh
Top achievements
Rank 1
Yogesh asked on 29 Feb 2012, 06:04 PM
We are evaluating Telerik HTML Editor for our application. One of the feature we are suppose to implement is to give a users a page construction capabilities where they will design their own page, but populate with data that are stored in database. We are going to provide a placeholder fields that will allow users to place database field in the page. In this way users will provide a user defined content and the database field will act as a place holder field that will populated dynamically when the page is executed. 

We have few questions on how to best implement this kind of solution.

1. What is the best way to implement such solution ? 
2. Is there any way we can dynamically inject our own HTML/Javascript to the editor as user places a database field ?
3. We need a data repeater kind of functionality, so users will need to ensure that they initiate this data repeater by placing a <start> place holder in the page and then place a <end> place holder. 

Let me know if you need any more info. 

Thanks in advance for your help. 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Mar 2012, 10:12 AM
Hi,

If I understand your scenario correctly, you wish your users to insert placeholders with the help of RadEditor and these placeholders will be replaced with some database content on the server.

Perhaps the easiest way to tackle this task would be to use *system* strings that have some fixed starting and ending characters, e.g. ##FirstName##, or @@FirstName@@ - or something similar. Of course you can highlight these strings with HTML tags and inline styles, e.g.

<span style="background-color: #ffc000;border: 1px solid red;">##FirstName##</span>

You should instruct your users what the list of those *system*strings is, so that they can insert those where needed. Then, on the server side, all you need to do is run some simple String.Replace methods that will replace such a string with the exact database row data.

Note that it is not possible to have only an opening or only a closing tags in the content area, because the browser works with DOM nodes and each node should have an opening and a closing tag, and if some of both is missing the browser will add it automatically.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Asked by
Yogesh
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or