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:
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?
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.
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:
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.
is working on a reply...