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

Forums / Bugs & Issues / Content Display

Content Display

4 posts, 0 answered
  1. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    14 Jun 2007
    Link to this post
    We came across a problem where we are getting three different looks for content added to a generic content module. First when you create a new item in the Generic Content module, you get the editor's version of the text. It displays paragraph tags and other html elements one way. When you click on Save Changes and the code is displayed to you, you get a whole new look. Then the third version happens to be when you view the content on the site when embedded in a page.

    I know that there is going to be differences between the admin section and the public view of the site because the themes and styles that are displayed in the actual site are not being imported into a generic content item. But this is a real problem when you have people who depend on the editors to style a page. As a developer I find it frustrating to code up a page and get it to look proper in the editor only to find that I have two totally different versions views after I am done.

    As a developer I have an advantage over our clients in that I can understand how the text is suppose to look once the actual style sheet is applied. But for our clients this is not acceptable. Has there been any thought about this? Is there any work-araounds I am not seeing?
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    15 Jun 2007
    Link to this post
    Hello Richard,

    We understand you but you will agree with us that Admin section has a different set of CSS classes in comparison with public site and the content can’t look in the same way on both places. But fortunately, we are using Rad Editor in the Sitefinity Administration area that is a very rich-text editor. It can be configured to load external CSS files. The CSS classes available in the external CSS files will populate the "Apply Css Class" dropdown. By applying this set of CSS classes to your content you can get an idea how it will look in the public area.

    You can display "Apply Css Class" dropdown through ~/Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml file:

    <tools name="DropdownToolbar" dockable="true">

    <tool name="ApplyClass" enabled="true"/>

    </tools>

    In order to populate it, you should modify ~/Sitefinity/Admin/ControlTemplates/EditorConfigFile.xml file as follows:

    <property name="CssFiles">

          <item>~/Sitefinity/Admin/Themes/Default/EditorStyles.css</item>

    </property>

    Hope this information will help you.

    Greetings,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    15 Jun 2007
    Link to this post
    Hi Pepi,
    I have actually already done this. I even went a step further and added in a drop down list to allow the user to switch between the themes setup for the site. This loads a css file for the given theme selected.

    The issue that is a problem is that if you add certain tags to the html in the editor and then save your changes, you get two different looks. For example, using your demo on this website. I can go and create a new Generic Content item, and then place an unordered list into the editor. The list looks fine with spacing and shows as a list with dots. Then once you save your changes, the text now looks like you just typed in text with line breaks. The same goes for the paragraph tags. If you add content wrapped with the paragraph tag, in the editor you have proper spacing. But once you save your changes and view the results, all of the text is stacked on top of each other without spacing.

    Why is it that the editor displays the text one way just using the standard html elements and then you get a different view when you view the content either in the admin section or on the actual site? Shouldn't the two match with just plain element tags? Now I know I can add a style sheet to the editor and to the admin section controls/pages to adjust this, I just think they should look the same without having to do this. If I want it to look different then I need to make adjustments.

  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    15 Jun 2007
    Link to this post
    Hello Richard,

    I am really sorry for the misunderstanding. We know about this problem with unordered list and paragraph. It is caused by overriding <ul> and <p> with styles that are loading in the Admin area. This issue will be fixed for the Service Pack and the content in the editor will look just like the content after saving.

    Hope this will solve your problem.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
4 posts, 0 answered