Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phil Crowe 192 posts 256 karma points
    Feb 16, 2011 @ 10:45
    Phil Crowe
    0

    adding styles through umbraco richtext editor not working

    Ive been following these instuctions to allow styles to be added through the richtext editor:
    http://our.umbraco.org/wiki/how-tos/customizing-the-wysiwyg-rich-text-editor-(tinymce)/add-styles-to-the-drop-down-menu-for-editors-to-use

    my client just needs two style; small and large text. they are showing in the richtext editor drop down and when i highlight text, select a style like 'large', the richtext editor applies the style. but then once i hit save the text reverts back to its previous style! any reason why this might be the case?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 16, 2011 @ 10:50
    Jan Skovgaard
    0

    Hi Phil

    How have you declared the styles in the stylesheet you use for the rich text editor?

    I'm thinking what does it look like, for these "entries" you have made for the stylesheet? (Name, alias, style) in the Umbraco stylesheet editor.

    Are you by any chance trying to insert <small> and <big> elements, with these styles?

    /Jan

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Feb 16, 2011 @ 12:16
    Michael Latouche
    0

    Hi Phil,

    Another explaination could be that the Rich Text editor does not allow by default to apply a "style" attribute on all tags. If the text you select contains such a tag, the style will not be saved.

    Cheers,

    Michael.

  • Bryan Drenner 37 posts 59 karma points
    Mar 03, 2011 @ 17:35
    Bryan Drenner
    0

    I'm having a similar problem.  My style shows up in the dropdown, but when I select it, the dropdown reverts back to the top "Styles" entry and applies nothing.  The rule being applied is:

    p .LogoCollage { text-align: center; }

    Update: I removed the "p" element from the rule, and it seems to work, although quirkily.

  • Doug Moore 48 posts 103 karma points c-trib
    Jan 12, 2012 @ 16:13
    Doug Moore
    0

    Hi Phil,

    Another explaination could be that the Rich Text editor does not allow by default to apply a "style" attribute on all tags. If the text you select contains such a tag, the style will not be saved.

    Cheers,

    Michael.

    Is there somewhere that I can find what tags don't work? 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 13, 2012 @ 00:06
    Jan Skovgaard
    0

    Hi Michael

    You can see the valid tags in the tinymceconfig.config file - hope this helps.

    /Jan

  • Doug Moore 48 posts 103 karma points c-trib
    Jan 13, 2012 @ 16:11
    Doug Moore
    0

    Either I did something wrong, or that wasn't the solution. I found a list of the full XHTML rule set on the TinyMCE site and that didn't even make the difference.

    My stylesheet property has the alias set to: blockquote.callOut

    If I highlight text, and choose the Call Out property it does nothing.

    If I remove "blockquote" from the alias it adds class="callOut" to the existing container (a "p" tag). 

    If I make the alias "blockquote .callOut" it does the same as "blockquote.callOut"

    If I make the alias simply "blockquote" it adds the blockquote tag.

    It seems to me that the "add an html tag with a class" part of the stylesheet property just isn't working. Can you confirm that you should be able to add an alias that contains both a tag and a class and it will add both to the HTML?

     

  • Stephen 767 posts 2273 karma points c-trib
    Feb 19, 2013 @ 11:44
    Stephen
    0

    Banging against the same issue, as perfectly described by Doug. Reading the docs, my understanding is that I should be able to create a style with alias "h2.something" and obtain <h2 class="something">...</h2> but that does not work.

  • Stephen 767 posts 2273 karma points c-trib
    Feb 19, 2013 @ 12:29
    Stephen
    0

    Responding to myself... checked the code and:

    If the alias starts with a dot, then it is a class and it is applied to the currently selected block (if any) or to a new span

    If the alias does not start with a dot, then it is a block type (eg <div>) and the current block changes for that type (eg <p> becomes <h2>).

    In the latter case, the alias should _not_ contain a dot as that is not handled by Umbraco. So no, at the moment it is _not_ possible to both set a block type and a class at the same time / with one unique style.

    Reference: plugins/umbracocss/editor_plugin_src.js

  • Stephen 767 posts 2273 karma points c-trib
    Feb 19, 2013 @ 12:34
    Stephen
    0

    And that would be feature request http://issues.umbraco.org/issue/U4-1736

  • Janet Kirklen 102 posts 212 karma points
    Sep 20, 2013 @ 18:24
    Janet Kirklen
    0

    I like the ability to set up specific styles for the editors. However you have to get it right the first time.  Any updates to the name or alias don't seem to save reliably. Changes are not reflected in the richtext editor style dropdown.  Even after deleting a style property, it still shows up in the richtext editor style dropdown. This seems to have been a bug for a very long time.  Are there others that are having this problem?  Is there a way around this?

  • John Halsey 59 posts 220 karma points
    Apr 08, 2014 @ 13:30
    John Halsey
    0

    I'm having a similar issue.

    I have created a h2 style that shows in the drop down. (not a class - no preceding dot). My client wants to be able to type in some text and change it to a heading, but you have to highlight the text and apply the style at least 3 times before it acknowledges what you want to do. In most cases, it just seems to remove the space (seems to be a break tag) under the highlighted text.

Please Sign in or register to post replies

Write your reply to:

Draft