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

Problems with stepping out from HTML markup

3 Answers 40 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Elena
Top achievements
Rank 1
Elena asked on 22 Sep 2014, 09:42 AM
Hi,

we are trying to use RadEditor within DotNetNuke CMS and here is the problem. 
We are saving small parts of HTML in templates to help content manager insert UI elements quicker.
But after pasting template content manager can't step out to the end of HTML makeup.
Example.
We have HTML template for button:
<a href="/some-page" class="green_btn">
<span class="bg">
<span class="icon"></span>
<span class="txt">Some text</span>
</span>
</a>
After insertion the cursor is placed at the end of "Some text" (see pic.1 attached) inside button. We need to skip to the end of HTML and continue to enter regular text (see pic.2 with desired cursor position). 
How we can do this? I mean - may be there is hot key for that? Or do we have to wrap templates in paragraphs or put but <br/>s in templates?
Click on the white space after button doesn't help. "End" and "Ctrl+End" keys can't help too.

3 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 25 Sep 2014, 08:52 AM
Hello Elena,

This happens because in this case there is no content, in which the cursor can be placed. You can avoid this behavior by always adding an &nbps; or a zero width space character (&#8203;) at the end of the content so that the cursor can be placed there.

Since the end of the content will change, you could create a custom content filter (http://demos.telerik.com/aspnet-ajax/editor/examples/contentfilters/defaultcs.aspx) that takes care of placing the character when the content of RadEditor is edited and removing it when the edited content is saved.

Regards,
Slav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Elena
Top achievements
Rank 1
answered on 29 Sep 2014, 02:32 PM
It worked, thank you so much!

Slav, BTW, could you please point us to any guidelines for creating HTML makeup that will work with editor smoothly?
We have plenty of HTML, that we want to make editable by content managers. When HTML is simple then editor works just fine.
But sometimes content gets broken after content manager simply inserts new line (for example, "div" element is replaced with "p" element). 
0
Ianko
Telerik team
answered on 02 Oct 2014, 05:15 AM
Hi Elena,

The RadEditor control support complex HTML structure and by the described issues I can only make assumptions what is the exact HTML markup causing the Editor to not work as expected.

Please, provide some markup examples or more descriptions how to locally recreate the same situation.

As for the div elements replaced by p ones, such behavior is encountered in previous versions of the RadEditor when it is set to DIV NewLineMode. I suggest upgrading to the latest available version (2014.2.724) and test again. Also, you can try if changing the NewLineMode to either Br or P resolves the issue.


Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Elena
Top achievements
Rank 1
Answers by
Slav
Telerik team
Elena
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or