Copied to clipboard

Flag this post as spam?

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


  • randomguy3 5 posts 0 karma points
    Jun 25, 2009 @ 12:25
    randomguy3
    0

    Inserting macros inline in content editor

    I have a macro that outputs an email address surrounded by a mailto: link.  This is a macro so that the email address can be changed in one place, and this changes it throughout the site.

    However, inserting it into the TinyMCE editor (Umbraco v4.0.2.1, TinyMCE v3) inserts it as a div, which cannot be nested inside a paragraph tag.  Although the div isn't output on the actual site, it confuses TinyMCE, which then splits the paragraph tag.  I can manually change the html to spans, and it seems to remember this, but then it still insists on putting a space after it (which is incorrect when the email address is at the end of a sentence).

    Is there any way to specify that a macro is inline (as opposed to block-level), and so should be rendered as such in the editor?

  • Jamie Pollock 27 posts 102 karma points c-trib
    Jun 25, 2009 @ 14:01
    Jamie Pollock
    1

    Well if you wish to continue down this route I suggest amending the style sheet asociated with your TinyMCE editor, you'll need to use the class which is given to the div like so:

    /* Note the "body.mceContentBody" selector is just for making sure the ".umbMacroHolder" you're selecting is in the TinyMCE, if you happen to also include this stylesheet on your website too. */

    body.mceContentBody .umbMacroHolder {
    display: inline;
    }

    /* if this doesn't work try ".mceNonEditable" */

    I hope this helps.

Please Sign in or register to post replies

Write your reply to:

Draft