Hi, I would like to ask a thing about using templates in tinymce. I followed the procedure described in the howto and it seems that it works fine, except that thenesteddivs arerearranged, deleting the inner div. My template is very simple:
I'm not sure why the issue occurs. But could you try and describe to us what it is you want to achieve? Why is it that it's neccesary for you to have templates in the rich text editor?
I'm asking becaue there maybe is a better way to achieve what you're after rather than having to struggle with some weird RTE behaviour :)
I have some code snippets, composed by very few line of html formatted text, that I would like to insert in a bodyText field only if it is relevant on a given page.
Unfortunately (or fortunately, indeed!) TinyMCE does not allow me to write nested divs so, since i don't want disable the cleanup facility of TinyMCE, I tried with the templates, but maybe there is a simpler solution that I do not know.
You just need to specify that the macro can be used in the rich text editor when you create it.
If you're using XSLT to render the content of the rich text editor field you need to be aware that you must use the umbraco.libary:Item extension to render the content. Perhaps this is also true for Razor...I can't remember exactly.
Hope this helps.
Please remember to mark the post as solved as well.
TinyMCE reformats nested divs in templates
Hi,
I would like to ask a thing about using templates in tinymce.
I followed the procedure described in the howto and it seems that it works fine, except that the nested divs are rearranged, deleting the inner div.
My template is very simple:
Any of you guys had this problem?
I apologize for my bad English and thank you in advance.
Davide
Hi Davide
I'm not sure why the issue occurs. But could you try and describe to us what it is you want to achieve? Why is it that it's neccesary for you to have templates in the rich text editor?
I'm asking becaue there maybe is a better way to achieve what you're after rather than having to struggle with some weird RTE behaviour :)
Looking forward to hearing form you.
/Jan
Hi Jan and thanks for your interest.
I have some code snippets, composed by very few line of html formatted text, that I would like to insert in a bodyText field only if it is relevant on a given page.
Unfortunately (or fortunately, indeed!) TinyMCE does not allow me to write nested divs so, since i don't want disable the cleanup facility of TinyMCE, I tried with the templates, but maybe there is a simpler solution that I do not know.
Davide
Hi Davide
From your description above I think that you could perhaps create a macro that could be inserted in the rich text editor instead?
Then you can have your code in either XSLT or Razor and not needing to struggle with the RTE formatting the HTML weird.
If you need the editor to be able to edit the text you can add one or more parameters to the macro and do it this way around instead.
Does the above suggestion make sense to you? And would it be acceptable in your context?
/Jan
Yes, jan, thank you!
I did not know the possibility of using macros in RTE.
The process seems similar to the one I used for the templates.
I will try to follow this tutorial:
http://www.mortenbock.dk/blog/2011/07/28/using-inline-macros-in-the-umbraco-editor.aspx
Thanks again! :)
Davide
Hi Davide
You're very welcome :)
You just need to specify that the macro can be used in the rich text editor when you create it.
If you're using XSLT to render the content of the rich text editor field you need to be aware that you must use the umbraco.libary:Item extension to render the content. Perhaps this is also true for Razor...I can't remember exactly.
Hope this helps.
Please remember to mark the post as solved as well.
Cheers,
Jan
All works fine, even if I had to disable tidy function in umbracoSettings.config.
Thanks again! :)
Davide.
is working on a reply...