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?
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. */
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?
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:
I hope this helps.
is working on a reply...