Heres the scenario: Umbraco creates a mega menu based on its contents and some setup variables via a Razor macro, I need to store the markup that is generated by that macro in a database as it is used by a Java app which makes up the other half of the website.
Is there any way to run the razor macro script in the actual c# code in my Document_AfterPublish event or do I have to set up a hidden page on the Umbraco site that will render just the mega menu markup and grab it from there?
Generate html via publish event
Heres the scenario: Umbraco creates a mega menu based on its contents and some setup variables via a Razor macro, I need to store the markup that is generated by that macro in a database as it is used by a Java app which makes up the other half of the website.
Is there any way to run the razor macro script in the actual c# code in my Document_AfterPublish event or do I have to set up a hidden page on the Umbraco site that will render just the mega menu markup and grab it from there?
I would throw the macro in a empty template and get the html in the Document_Afterpublish via the ?alttemplate=justthemacro
You can then get the html with
Many thanks,
Works like a charm and no clutter from my users perspective.
cheers
Simon
is working on a reply...