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?
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.
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.
Own tags with tinymce
Hi, I want to surround selected text with own tags in tinymce editor by clicking a button.
" like it is done with hyperlinks.For example I want to surround css code like this "
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?
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
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.
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.
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
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
is working on a reply...