Copied to clipboard

Flag this post as spam?

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


  • rvo 1 post 21 karma points
    Mar 13, 2011 @ 14:53
    rvo
    0

    Razor macro in tinyMCE editor

    Hi,

    I have just been experimenting with creating macros based on razor/cshtml scripts in Umbraco 4.7RC.

    Whilst it is possible to insert razor based macros inline in the tinyMCE editor, the following error message is displayed when rendering the macro before the document has been published for the first time:

    Error loading MacroEngine script (file: ImageGallery.cshtml)
    The macro works fine when previewing the document (also before being published) and also renders well in the editor after publishing the document for the first time.
    The problem is not linked to invalid razor code, since it occurs even for a blank template.
    Is there a logical explaination for this sort of behavior?
    Thanks!
    rvo

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Mar 13, 2011 @ 14:55
    Sebastiaan Janssen
    0

    Razor works with publishes content only, because that is cached and really fast to access. As such,it is not possible to show a preview when the node is not published. I think you would have the same problem with and XSLT macro if you tried it.

Please Sign in or register to post replies

Write your reply to:

Draft