+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / WYSISWYG issue - hitting enter at the end of line in the editor

WYSISWYG issue - hitting enter at the end of line in the editor

11 posts, 0 answered
  1. Gary
    Gary avatar
    91 posts
    Registered:
    19 Jul 2007
    09 Jan 2009
    Link to this post
    There are a lot of things I like about Sitefinity, but unfortunately the WYSISWYG editor is not one of them, and to be honest ever since I started using Sitefinity I have found it impossible to use the design view of the editor because it behaves so erratically. I now routinely write everything from the source view. That’s fine for me, but my concern is that customers who manage content are experiencing a similar frustrating experience.

    In this context, I’d like to share some constructive criticism on one of the WYSISWYG capabilities within Sitefinity to solicit your feedback and perhaps correct me on incorrect assumptions I may have made.

    Working with headings is a very common task for content editors. Here is a simple walkthrough that demonstrates the difficulties when using Firefox 3:

    Step 1: Type some text, select it and change to Heading 1, then go to the end of the line and hit enter.

    Now the designer shows a “p” selected in the styles dropdown (which isn’t a valid entry in the list), and a blank character has mysteriously appeared at the beginning of the next line, which is in a selected state. Both of these things are odd. A quick look at the markup shows:
    <h1>Heading
    <p>&nbsp;</p>
    </h1>
    Step 2: When starting to type, I find that my current style is still Heading 1.  So I type a few letters and then go to the styles dropdown (which still shows a “p”) and select Normal. It doesn’t work. The cursor just moves back to the beginning of the first line and the selected style remains “p”. My markup is now:
    <h1>Heading
    <p>
    <p>Hello</p>
    </p>
    </h1>
    Both of these simple actions produced invalid markup. The first step should have produced this markup instead:
    <h1>Heading</h1>
    <p></p>
    However, if I manually edit the markup to this and then return to design view then I am stuck on the heading line and have no way of placing text between the <p> tags.

    Performing the same experiment in IE7, yields different behavior and results. At the end of step 1 the markup produced is:
    <h1>
    <p>heading</p>
    </h1>
    In this case there is no automatically created blank character (which is good). However, the bold button is now selected even though the markup doesn’t contain any element to support this. In addition, the selected style shows Normal (which is better than “p”), but when I start typing the Heading 1 style still applies.

    There are other issues, but this post is getting long so I’ll write about other problem scenarios another time. For your information, I performed these tests with the latest version of Sitefinity (3.5 SP1). These issues seem very basic and it seems odd to experience these problems with an editor that has been on the market now for several years.

    On a final note, I would personally love to see a WYSISWYM (What You See Is What You Mean) approach to editing because I think it effectively bridges the gap that allows non-technical people to work with content without destroying the markup. I searched the ASP.NET AJAX Editor forum for WYSISWYM and found no results, so I guess it’s not something that many people are asking yet.

    Regards,
    Gary
  2. Rumen
    Rumen avatar
    26 posts
    Registered:
    08 Dec 2016
    14 Jan 2009
    Link to this post
    Hello Gary,

    Thank you for your feedback! We are always improving our controls and we will do our best to help you resolve the problems that you experience.

    Straight to the points:

    1. The default behavior of the Enter command in Mozilla (Gecko) editors is to insert a <br> tag. In order to provide support for paragraph insertion under Firefox we made a custom implementation (NewLineBr="false") which has its limitations because of the different browser problems and behaviors.

      The reported and observed behavior is a side effect of our code and it is not an easy task to workaround or fix it. The problem is already logged in our ToDo list and if possible we will fix it in one of the future versions of RadEditor.

      Currently, my suggestion is to set the RadEditor's NewLineBr property to true in all modules where you use RadEditor. For example, open the \Project_Name\Sitefinity\Admin\ControlTemplates\News - ControlPanelInsert.ascx and set in the RadEditor declaration NewLineBr="true". To the same for all other modules where the editor resides.
      Thus the editor will insert a <br/> tag on enter key press and the problems described in steps 1 and 2 will not exist.
       
    2. In regards to the reported problem under Internet Explorer: We are aware of it and we plan to rewrite the FormatBlock functionality of RadEditor in one of the next versions of the control, which will solve the problem.

      What I would suggest as a temporary workaround until our developers solve the problem is to use the default browser FormatBlock tool command instead of the RadEditor's one. You can easily enable it by putting the following javascript code under the RadEditor's declaration in all modules where RadEditor resides, e.g. open the \Project_Name\Sitefinity\Admin\ControlTemplates\News - ControlPanelInsert.ascx  file and put the js code below under the RadEditor declaration:

      <script type="text/javascript">
      Telerik.Web.UI.Editor.CommandList["FormatBlock"] = function(commandName, editor, args)
      {     
          var oValue = args.get_value();
          // Call the FormatBlock command of the browser directly!     
          // alert ("Format block command was replaced with a custom version");     
          editor.get_document().execCommand("FormatBlock", null, oValue);  //this code uses the underlying IE FormatBlock tool
      };
      </script>

      Save the file.

      This will fix the reported problem with the nested paragraph in heading tags: <h1>
      <p>heading</p>
      </h1>

    Kind regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Darchele
    Darchele avatar
    24 posts
    Registered:
    08 Sep 2006
    19 Aug 2009
    Link to this post
    In version 3.6 and greater how can you change the default behavior of the enter key for the WYSIWYG editor.  The file referenced as an example no longer exists....

    \Project_Name\Sitefinity\Admin\ControlTemplates\News - ControlPanelInsert.ascx

    Please advise.
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Aug 2009
    Link to this post
    Hi Darchele,

    Thank you for using our services.

    In version 3.6 and above the control templates have changed. For the News Module the template for creating new News items is ~/Sitefinity/ControlTemplates/NewsItemNew.ascx. Please note that if you have not downloaded the External Templates for your version of Sitefinity you will not have access to the control templates. You can download the templates from your Client.Net account.

    Greetings,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  5. Darchele
    Darchele avatar
    24 posts
    Registered:
    08 Sep 2006
    19 Aug 2009
    Link to this post
    Does the same apply for the Generic Content WYSIWYG editor and the general editor used for updating page and template content?

    Please refer to next post for more specific question.
  6. Darchele
    Darchele avatar
    24 posts
    Registered:
    08 Sep 2006
    19 Aug 2009
    Link to this post
    I downloaded the external template for .Net 3.5 and modified all of the references to the RadEditor in the \Generic_Content\ folder to include the line NewLineBr="true", but nothing appears to have changed when editing pages. 

    Please let me know where I need to make these changes so that the NewLineBr takes affect.

    Thanks,

    Darchele
  7. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    19 Aug 2009
    Link to this post
    Hi Darchele,

    The same applies for the rest of the controls that are using the RadEditor for imputing text. Since Sitefinity 3.6 the template names for creating and editing  Generic Content in the module are ~/Sitefinity/Admin/ControlTemplates/Generic_Content/ConentNewView.ascx and ~/Sitefinity/Admin/ControlTemplates/Generic_Content/ConentEditView.ascx. The one for the editing content directly in pages is ~/Sitefinity/Admin/ControlTemplates/Generic_Content/GenericContentDesigner.ascx.

    After you have edited the templates you need to "tell" the controls to use the external templates. This is a change from older versions of Sitefinity, since we now use embedded templates. To see how to map controls to use external templates, please read here - Mapping a control to use external template.

    Sincerely yours,
    Rado
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Darchele
    Darchele avatar
    24 posts
    Registered:
    08 Sep 2006
    20 Aug 2009
    Link to this post
    I followed the instructions.  Below is what I have in my Telerik.Sitefinity.Configuration.ControlsConfig.xml file.  I have also included all of the controls and changed all references from NewLineBr="False" to NewLineBr="True".  I then restarted IIS and even rebooted my computer.  But, I'm not seeing the changes.  When I hit return it still creates a new paragraph instead of a br tag.  What am I doing wrong?

    Please advise.

    Darchele Webb

    <?

     

    xml version="1.0" encoding="utf-8"?>

     

    <

     

    controlsConfig>

     

    <

     

    viewMap>

     

    <!--

     

    Provides user interface for displaying a list of content items in the Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemsList`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentItemsList.ascx" />

     

    <!--

     

    Provides user interface for previewing a content item in the Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemPreview`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentPreview.ascx" />

     

    <!--

     

    Provides user interface for editing a content item in the Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemEdit`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentEditView.ascx" />

     

    <!--

     

    Provides user interface for adding a new content item in the Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemNew`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentNewView.ascx" />

     

    <!--

     

    Provides user interface for managing history of different versions of the content item in the Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemHistory`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/ContentItemHistory.ascx" />

     

    <!--

     

    Provides user interface for managing categories in Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.CategoriesView`1[[Telerik.Cms.Engine.WebControls.Admin.GenericControlPanel, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/CategoriesView.ascx" />

     

    <!--

     

    Provides user interface for managing tags in the Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.TagsView`1[[Telerik.Cms.Engine.WebControls.Admin.GenericControlPanel, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/TagsView.ascx" />

     

    <!--

     

    Provides user interface for displaying a list of comments in Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.CommentsList`1[[Telerik.Cms.Engine.WebControls.Admin.CommentsView`1[[Telerik.Cms.Engine.WebControls.Admin.GenericControlPanel, Telerik.Cms.Engine]], Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/CommentsList.ascx" />

     

    <!--

     

    Provides user interface for editing a comment in Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.CommentsEdit`1[[Telerik.Cms.Engine.WebControls.Admin.CommentsView`1[[Telerik.Cms.Engine.WebControls.Admin.GenericControlPanel, Telerik.Cms.Engine]], Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/CommentsEdit.ascx" />

     

    <!--

     

    Provides user interface for previewing a comment in Generic Content.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.CommentsPreview`1[[Telerik.Cms.Engine.WebControls.Admin.CommentsView`1[[Telerik.Cms.Engine.WebControls.Admin.GenericControlPanel, Telerik.Cms.Engine]], Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/CommentsPreview.ascx" />

     

    <!--

     

    Provides user interface for managing permissions in the Generic Content module.-->

     

    <

     

    viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.PermissionsView`1[[Telerik.Cms.Engine.WebControls.Admin.GenericControlPanel, Telerik.Cms.Engine]]" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/PermissionsView.ascx" />

     

    </

     

    viewMap>

     

    </

     

    controlsConfig>

     

  9. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    24 Aug 2009
    Link to this post
    Hello Darchele,

    Thank you for getting back to us.

    In one of your above posts you mentioned that you want to edit this property for the editor window that shows when editing pages in the page editor. I mean the Generic Content control that you drop from the toolbox, not the Generic Content View control, that is used for displaying content from the module. The associated control template for the Generic Content control is ~/Sitefinity/Admin/ControlTemplates/Generic_Content/GenericContentDesigner.ascx. I have referenced in my previous post, however I do not see it mapped in your controls config. Please make sure that you have the following in the ControlsConfig file, and that the respective file is modified accordingly:
    <!--Defines the layout of GenericContentDesigner control.--> 
    <viewSettings hostType="Telerik.Cms.Engine.WebControls.Design.GenericContentDesigner" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Generic_Content/GenericContentDesigner.ascx" /> 

    Best wishes,
    Rado
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  10. Herman
    Herman avatar
    6 posts
    Registered:
    22 Jun 2009
    03 Sep 2009
    Link to this post
    A bit different but maybe very alike: I always want a p even wat a single paragraph. When entering just 1 word or line of text there is no <p> generated. Onyl when there is a return (enter) a p is generated. We use the p in our styling for paddings and have a problem with single paragraphs now. How can we fix this?    
  11. Stoyanka Assenova
    Stoyanka Assenova avatar
    113 posts
    Registered:
    01 Dec 2016
    03 Sep 2009
    Link to this post
    Hi Herman,

    Please do the following steps:

    1. Map the external template for the view you want to modify.
    2. Remove the "FixEnclosingP" content filter in the ContentNewView.ascx file, ContentEditView.ascx file and GenericContentDesigner.ascx file. You can find these templates in Sitefinity/Admin/ControlTemplates/GenericContent folder.

    You can read more information about "FixEnclosingP" content filter in the following help article.

    Hope this helps.

    Sincerely yours,
    Stoyanka Assenova
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
11 posts, 0 answered