Best-practice approaches with TinyMCE and snippets?
For quite some time my relationship with TinyMCE has been a bit tense, but now I determined that I want to improve it by implementing some best-practices approaches in my use of TinyMCE (Umbraco v4).
Using the UI styles and stylesheet properties works nicely. Using styles for headings, paragraphs etc. is great (http://forum.umbraco.org/yafpostst1971p2TinyMce-Format-dropdown-and-html-templatessnippets-workaround.aspx).
I am, however, really missing some extra features before the usage is optimal (for normal content I would prefer limiting direct html editing, like manually adding
tags etc.), and thus I'm looking for ways to improve my setup - I may be missing important points on the usage, but then I hope to learn...
Two examples of the extensions I would like to make could be specification of:
1) snippets of code, e.g. div, textarea or advanced syntax-highlighting elements (like CodeMirror) for nicely formatting a code-snippet (indent, background colors,...)
2) media-images containing captions from the media-type
Approach 1: Lefteris snippets
I looked a bit into Lefteris snippet extension (http://forum.umbraco.org/yafpostst1971TinyMce-Format-dropdown-and-html-templatessnippets-workaround.aspx). This could solve my issue to some extend.
Pros:
a. The snippets would be quite easy to add.
Cons:
a. The snippets would be static
b. It requires some modifications to the standard Umbraco, and the functionality may get compromised when upgrading Umbraco
c. I cannot get it to work on v4.
Approach 2: Macro snippets
Originally I was thinking of another approach, which I quite like the idea of: making an umbraco-macro for every snippet.
Pros:
a. Easy Umbraco-style approach
b. It would survive upgrades
c. I would be able to add any kind and complexity of tags containing dynamic content passed by parameters.
Cons:
a. I cannot modify macro parameters from TinyMCE
b. Passing text-parameters highly depends of the text-content, because several characters (like ") invalidates the macro call. Improved url-sencoding or similar would be needed.
Right now none of the solutions I can come up with are really satisfactory, so I wonder if I'm using it the right way - my guess is that I'm not the only person on the planet wanting to use this kind of functionality.
I don't know if it makes sense - any ideas and comments are welcome.
Ok, snippet-support is maybe not a hot issue right now ;-)
In my quest for optimizing my TinyMCE editor handling, I'm now trying to use the styles-dropdown and stylesheet for handling source-code examples that I want to show on my site.
Using
Best-practice approaches with TinyMCE and snippets?
For quite some time my relationship with TinyMCE has been a bit tense, but now I determined that I want to improve it by implementing some best-practices approaches in my use of TinyMCE (Umbraco v4).
Using the UI styles and stylesheet properties works nicely. Using styles for headings, paragraphs etc. is great (http://forum.umbraco.org/yafpostst1971p2TinyMce-Format-dropdown-and-html-templatessnippets-workaround.aspx).
I am, however, really missing some extra features before the usage is optimal (for normal content I would prefer limiting direct html editing, like manually adding
Two examples of the extensions I would like to make could be specification of:
1) snippets of code, e.g. div, textarea or advanced syntax-highlighting elements (like CodeMirror) for nicely formatting a code-snippet (indent, background colors,...)
2) media-images containing captions from the media-type
Approach 1: Lefteris snippets
I looked a bit into Lefteris snippet extension (http://forum.umbraco.org/yafpostst1971TinyMce-Format-dropdown-and-html-templatessnippets-workaround.aspx). This could solve my issue to some extend.
Pros:
a. The snippets would be quite easy to add.
Cons:
a. The snippets would be static
b. It requires some modifications to the standard Umbraco, and the functionality may get compromised when upgrading Umbraco
c. I cannot get it to work on v4.
Approach 2: Macro snippets
Originally I was thinking of another approach, which I quite like the idea of: making an umbraco-macro for every snippet.
Pros:
a. Easy Umbraco-style approach
b. It would survive upgrades
c. I would be able to add any kind and complexity of tags containing dynamic content passed by parameters.
Cons:
a. I cannot modify macro parameters from TinyMCE
b. Passing text-parameters highly depends of the text-content, because several characters (like ") invalidates the macro call. Improved url-sencoding or similar would be needed.
Right now none of the solutions I can come up with are really satisfactory, so I wonder if I'm using it the right way - my guess is that I'm not the only person on the planet wanting to use this kind of functionality.
I don't know if it makes sense - any ideas and comments are welcome.
Ok, snippet-support is maybe not a hot issue right now ;-)
In my quest for optimizing my TinyMCE editor handling, I'm now trying to use the styles-dropdown and stylesheet for handling source-code examples that I want to show on my site.
Using
is working on a reply...
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.