When I insert the Macro into the content Editor (TinyMCE) automatically it create a div tag with class="umbMacroHolder" that contains macro parameters and the rendered output.
The problem is that I need to view the output inline.
Is there a way to specify how the output must be rendered?
The first thing I realized is that the "umbMacroHolder" div is only shown in the richtext editor and isn't rendered on the live site. It's used to put the border around the macro in the RTE (richtext editor).
Thus, I had two options... either live with it as a display quirk in umbraco's RTE (what I do 99% of the time) or add a bit of css so that the div uses display:inline; by adding that to the a css file associated with the RTE. The disadvantage of making "umbMacroHolder" display inline is that it makes it harder to work with macros after they are inserted into the RTE, and with the border around it you still don't quite get 100% wysiwyg.
The full scenario for this issue is the following: we are trying to give our editors a macro to insert links to PDFs in media library which, when rendered, automatically adds a link to a text version of the PDF.
After digging a bit deeper on these, we found that the real problem is that Umbraco closes an open <p> tag before inserting the <div> containing the macro, so that the output from the macro is not inline.
As an example, we would like to obtain something like this:
I know you'll get the 3 lines in the RTE, but when you look at the page as rendered on the live site, do you still get the 3 lines or (because of the markup you use in your macro) do you get a single line?
I'm having exactly the same issue on v4.5.2. The macro content is on separate lines in both the front end and editor.
At least on the front end I need the content to be inline, but the editor adds /p-tag before the macro content, because the macro is rendered as a div in the editor.
If the preview of macro content would work in the editor I suppose that might solve the problem? But the preview does not work, and from searching this forum that seems to be a known bug?
Another solution would be to have the macro tag in editor to be a span rather than div, optionally.
I made a jquery hack to solve this front end. The macro output is wrapped in a css-class 'moveIntoPrecedingP' in order to find it:
I too wish that the macro-handling in the RTE was more robust.
My macro/RTE wishlist:
No extraneous HTML added or changed (p tags, for instance)
Use of span tag for macro display
When "render output" is turned off, I would like the message displayed to be the name of the macro, not the generic "This macro does not provides rendering in WYSIWYG editor"
Help: How can I view macro output inline?
Hi to all,
I'm using Umbraco v 4.0.3
I have a macro that output two links.
When I insert the Macro into the content Editor (TinyMCE) automatically it create a div tag with class="umbMacroHolder" that contains macro parameters and the rendered output.
The problem is that I need to view the output inline.
Is there a way to specify how the output must be rendered?
Thank you
Adriano
I ran into this a few times as well.
The first thing I realized is that the "umbMacroHolder" div is only shown in the richtext editor and isn't rendered on the live site. It's used to put the border around the macro in the RTE (richtext editor).
Thus, I had two options... either live with it as a display quirk in umbraco's RTE (what I do 99% of the time) or add a bit of css so that the div uses display:inline; by adding that to the a css file associated with the RTE. The disadvantage of making "umbMacroHolder" display inline is that it makes it harder to work with macros after they are inserted into the RTE, and with the border around it you still don't quite get 100% wysiwyg.
But try it and see if you like the effect of
or not.
cheers,
doug.
The full scenario for this issue is the following: we are trying to give our editors a macro to insert links to PDFs in media library which, when rendered, automatically adds a link to a text version of the PDF.
After digging a bit deeper on these, we found that the real problem is that Umbraco closes an open <p> tag before inserting the <div> containing the macro, so that the output from the macro is not inline.
As an example, we would like to obtain something like this:
but we end up with this:
Any hint?
Sorry Douglas,
didn't see your answer before posting.
AW our problems are mostly on the frontend, I think we could manage a not so perfect view in the RTE as long as the output is fine.
Marco
I know you'll get the 3 lines in the RTE, but when you look at the page as rendered on the live site, do you still get the 3 lines or (because of the markup you use in your macro) do you get a single line?
cheers,
doug.
Yes, I still get the 3 lines.
The problem is that the RTE inserts a paragraph closing tag before the macro DIV, and that </p> is kept on save and is published!
I'm having exactly the same issue on v4.5.2. The macro content is on separate lines in both the front end and editor.
At least on the front end I need the content to be inline, but the editor adds /p-tag before the macro content, because the macro is rendered as a div in the editor.
If the preview of macro content would work in the editor I suppose that might solve the problem? But the preview does not work, and from searching this forum that seems to be a known bug?
Another solution would be to have the macro tag in editor to be a span rather than div, optionally.
I made a jquery hack to solve this front end. The macro output is wrapped in a css-class 'moveIntoPrecedingP' in order to find it:
$(".moveIntoPrecedingP").each(function(index){
$(this).prev().append(' ').append(this);
});
Surely there must be a better way to solve this?
I too wish that the macro-handling in the RTE was more robust.
My macro/RTE wishlist:
is working on a reply...