Copied to clipboard

Flag this post as spam?

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


  • Timsn 121 posts 231 karma points
    Feb 17, 2009 @ 23:28
    Timsn
    1

    Own tags with tinymce

    Hi, I want to surround selected text with own tags in tinymce editor by clicking a button.
    For example I want to surround css code like this "

    my css code
    " like it is done with hyperlinks.
    I think the style dropdown in tinymce can't do that so I have to add my own button to it.
    How can I add a button with my functionality?

  • Chris Koiak 700 posts 2626 karma points
    Aug 05, 2009 @ 21:25
    Chris Koiak
    3

    Hi Timsn,

    You can create your own 'tempaltes', i.e. html, that is injected into tinyMCE. This may achieve what you're looking for.

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

    Cheers,

    Chris

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Aug 05, 2009 @ 21:43
    Sebastiaan Janssen
    0

    I've actually been looking for this as well.

    Thanks Chris, that is a great start, but like Timsn, I also really want to be able to select a piece of text, hit the button and have it surrounded with a certain tag. This just inserts some pre-defined html.

  • Chris Koiak 700 posts 2626 karma points
    Aug 05, 2009 @ 22:39
    Chris Koiak
    0

    I had a similar requirement, it was for a specific implementation of <blockquote/>. I decided just to go with the template approach, but default some test in the centre of my markup, e.g.

    <blockquote><span class="startquote"/>Please change this text<span class="endquote"/></blockquote>

    What you're looking for must be possible with TinyMCE, but probably needs a bit of digging around to find out the detail. Sorry I can't be more help.

    Chris

  • Tom 713 posts 954 karma points
    Aug 09, 2010 @ 09:48
    Tom
    0

    Hi just wondering if a solution was found for this? I'd love to be able to add a button the user can click that wraps some content in tags

    yes templating would be an ok approach but not exactly what i had in mind!

    Cheers,

    Tom

Please Sign in or register to post replies

Write your reply to:

Draft