Copied to clipboard

Flag this post as spam?

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


  • Andrew Cullen 137 posts 237 karma points
    Jun 28, 2012 @ 19:11
    Andrew Cullen
    0

    Creating styled elements in TinyMCE

    I'm looking to allow writers to create the following snippet using TinyMCE without resorting to the HTML button:

    <div class="info">
    <h4>Info box title</h4>
    <p>Info box content</p>
    </div>

    I've tried associating the TinyMCE control with a CSS sheet, and creating the appropriate ".info" style. That automatically creates a span, not a div, which I could live with by tweaking the CSS. However, the internal elements also get the class appended to them. Is there any way to use TinyMCE to provide non-technical users with structured HTML snippets without forcing those users to get more technical than they can handle?

  • Nigel Wilson 944 posts 2076 karma points
    Jun 28, 2012 @ 22:07
    Nigel Wilson
    0

    Are you able to code the <div> into the user control / xslt / razor when outputting the data?

    That would remove the "class" assignment issue and make this possible. 

    Cheers, Nigel

  • Mike Chambers 635 posts 1252 karma points c-trib
    Jun 29, 2012 @ 10:48
    Mike Chambers
    0

    http://our.umbraco.org/wiki/how-tos/enabling-the-'template'-plugin-for-tinymce

    How's about leveraging the tinymce template plugin you could then insert your default html as above, allowing your editor to then just change the default text as they require?

  • Michael Latouche 504 posts 819 karma points MVP 3x c-trib
    Jun 29, 2012 @ 13:32
    Michael Latouche
    0

    Hi Andre,

    You might also want to have a look at the widget dropper package: http://our.umbraco.org/projects/website-utilities/widget-dropper

    I have not used it myself, but it seems to map more or less with what you need.

    Cheers,

    Michael.

Please Sign in or register to post replies

Write your reply to:

Draft