Is it possible to get hold of the Design part of a chosen template as text string - exactly the way it's saved in the database?
I'm trying to store the saved document as a pure html file using the chosen template from an aftersave event handler. I've created a template with a simple but complete markup using no master template, but of course Umbraco will put my template inside a master placeholder anyway.
I've tried to retreieve it via the template.Design property, but then I only get a stripped version, missing html,header and body markup. I'm using version 4.7.
Get Template Design as a text string
Hi guys
Is it possible to get hold of the Design part of a chosen template as text string - exactly the way it's saved in the database?
I'm trying to store the saved document as a pure html file using the chosen template from an aftersave event handler. I've created a template with a simple but complete markup using no master template, but of course Umbraco will put my template inside a master placeholder anyway.
I've tried to retreieve it via the template.Design property, but then I only get a stripped version, missing html,header and body markup. I'm using version 4.7.
Do I have to query the database directly?
Once again, solved by myself.
Turns out I tested my results by displaying the template text in rich text editor field, which of course did a lot of markup stripping.
Please don't ask me why I didn't realize this at once. I'm now writing results to a txt file and I'm now using template.Design successfully :-)
is working on a reply...