Copied to clipboard

Flag this post as spam?

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


  • Adriano Fabri 469 posts 1633 karma points
    Mar 03, 2010 @ 12:23
    Adriano Fabri
    0

    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

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Mar 03, 2010 @ 12:51
    Douglas Robar
    0

    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

    .umbMacroHolder { display: inline; }

    or not.

    cheers,
    doug.

  • Marco Lusini 176 posts 1370 karma points
    Mar 03, 2010 @ 12:56
    Marco Lusini
    0

    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:

    Bla bla bla Nice PDF paper (Text version) bla bla bla

    but we end up with this:

    Bla bla bla

    Nice PDF paper (Text version)

    bla bla bla

    Any hint?

  • Marco Lusini 176 posts 1370 karma points
    Mar 03, 2010 @ 12:59
    Marco Lusini
    0

    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

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Mar 03, 2010 @ 12:59
    Douglas Robar
    0

    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.

  • Marco Lusini 176 posts 1370 karma points
    Mar 03, 2010 @ 14:24
    Marco Lusini
    0

    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!

     

  • Daniel Lindstrom 454 posts 271 karma points
    Dec 19, 2010 @ 08:50
    Daniel Lindstrom
    0

    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?

  • Heather Floyd 609 posts 1031 karma points MVP 6x c-trib
    May 17, 2011 @ 15:49
    Heather Floyd
    0

    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"

     

Please Sign in or register to post replies

Write your reply to:

Draft