Copied to clipboard

Flag this post as spam?

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


  • Davide Oliva 35 posts 199 karma points
    Jan 29, 2013 @ 11:02
    Davide Oliva
    0

    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:

    <div class="sezioneSX"><div class="titolo">Approfondimenti</div></div

    Any of you guys had this problem?

    I apologize for my bad English and thank you in advance.

    Davide

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 29, 2013 @ 19:48
    Jan Skovgaard
    0

    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

  • Davide Oliva 35 posts 199 karma points
    Jan 29, 2013 @ 20:59
    Davide Oliva
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 29, 2013 @ 21:06
    Jan Skovgaard
    0

    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

  • Davide Oliva 35 posts 199 karma points
    Jan 29, 2013 @ 21:20
    Davide Oliva
    0

    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

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 29, 2013 @ 21:34
    Jan Skovgaard
    100

    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 

  • Davide Oliva 35 posts 199 karma points
    Jan 30, 2013 @ 21:32
    Davide Oliva
    0

    All works fine, even if I had to disable tidy function in umbracoSettings.config.

    Thanks again! :)

    Davide.

Please Sign in or register to post replies

Write your reply to:

Draft