Copied to clipboard

Flag this post as spam?

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


  • Jules 276 posts 588 karma points
    Jan 09, 2012 @ 19:10
    Jules
    0

    Restrict to H2 only in Rich Text Editor

    Hi

    I want to be able to allow only h2 markup in the rich text editor.  The html usually defaults to a p if no style is selected.

    Is there any way to do this ie I want the WYSIWIG editing but the underlying html should default to H2 elements.

    Anyone know if this is possible?

    Thanks

    Julian

  • Jan Skovgaard 11280 posts 23678 karma points MVP 12x admin c-trib
    Jan 09, 2012 @ 21:24
    Jan Skovgaard
    0

    Hi Julian

    Do you want to make all of the text enteren in the RTE field a <h2> ? In that case would'nt it be better to create a textring or textring multiple property?

    If you just want to be able to mark up parts of the text in the RTE field with a <h2> tag then you should just go to the settings section and create a style called "rte" under the "stylesheets" folder - then right click the rte stylesheet to add a heading. Make sure it says "h2" in the alias field - without the quotes.

    Then in the developer section expand the datatypes folder and go to the "rich text editor" datatype and associate the rte stylesheet. Also make sure that the "styles" dropdown box is checked.

    Hope this helps.

    /Jan

  • Jules 276 posts 588 karma points
    Jan 09, 2012 @ 22:13
    Jules
    0

    Thanks Jan

    Althogh I know how to do all of this stuff.

    The RTE is being used for the text of a leader paragraph which is going to be 2 or 3 paragraphs of larger text that is followed by normal paragraphs (p). I thought it would be good to utilise the the WYSIWIG of the RTE for this purpose as long as I could get it to generate H2 for each new paragraph instead of the default p.

    Its not the end of the world so I think I will have to go with a div called leader in the template and put p inside of that so I can format div.leader p in the css.

    Thanks again

    Jules

  • Jan Skovgaard 11280 posts 23678 karma points MVP 12x admin c-trib
    Jan 09, 2012 @ 23:26
    Jan Skovgaard
    0

    Hi Jules

    Ok, in that case I think I would just go for a textstring multiple.

    But if you still need to use the RTE field you can easily strip all the html by using the umbraco.library:StripHtml() extension and then just wrap the content in <h2></h2>

    /Jan

  • Funka! 398 posts 661 karma points
    Jan 10, 2012 @ 23:15
    Funka!
    0

    Hi Julian,

    I think your idea of wrapping the <p> tags in a div with an ID or class that you can style to be bigger/bolder/whatever was my first though of what I would do. This would probably be the quickest solution at least, but would also more closely preserve the semantic intention of a "heading" to be exactly that, rather than being used as a synopsis or abstract like you were already suggesting.

    Best of luck!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies