Copied to clipboard

Flag this post as spam?

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


  • Euan Rae 105 posts 135 karma points
    Mar 20, 2012 @ 15:49
    Euan Rae
    0

    Razor script in a RTE not rendering

    I have a razor macro that an editor can add into the RTE.  The contents of this field 'bodyContent' is also rendered from another razor script.  The issue is that the macro that is inserted into the RTE isn't rendering (sometimes), in the html, it's outputting: <!--?UMBRACO_MACRO image="1542" macroAlias="ShowResizedContentImage" /-->, but only on the staging environment.  If I run it on my local machine, it works fine.

    The code is below:

    @Html.Raw(
              umbraco.library.RenderMacroContent(
                     Model.GetProperty("bodyContent").Value,
                     Model.Id
                )
            );

    which from what i've should resolve the issue.

    What I can't understand is why it work locally but not on a staging environment.  Is there anything in configuration/environment settings that can cause Razor macros to behave differentyl?

Please Sign in or register to post replies

Write your reply to:

Draft