Copied to clipboard

Flag this post as spam?

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


  • Siw Ørnhaug 130 posts 109 karma points
    Sep 15, 2011 @ 14:33
    Siw Ørnhaug
    0

    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?

  • Siw Ørnhaug 130 posts 109 karma points
    Sep 15, 2011 @ 15:19
    Siw Ørnhaug
    0

    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 :-)

     

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies