Copied to clipboard

Flag this post as spam?

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


  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Feb 08, 2013 @ 21:06
    Dennis Aaen
    0

    How to get the xml of "currentPage" in Razor

    Hi,

    I am quite new Razor in Umbraco. I used to work with XSLT when I'm working in Umbraco. But I am now begun looking at razor, after having been on the Umbraco training.

    How can I access the XML from "currentPage" in XSLT, can I do it this way.

    <teaxtarea><xsl:copy-of select="$currentPage" /></textarea>

    But how can I access xml in Razor, I know that I access "currentPage" by @Model, but when I wrapped it in a textarea i only get this umbraco.MacroEngines.DynamicNode.

    How can I get the raw xml.

    Any help will be appreciated.

    /Dennis

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 09, 2013 @ 00:48
    Jan Skovgaard
    0

    Hi Dennis

    Being a Razor n00b myself I'm not sure this is even possible.

    But I woud like to know what version of Umbraco you're using since and if you're using webforms or MVC since there is a difference wether you're using macroscript razor or MVC razor in Umbraco - it's 2 different implementations.

    Looking forward to hearing more from you.

    /Jan

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Feb 09, 2013 @ 09:33
    Dennis Aaen
    100

    Hi Jan,

    I just played around with the Umbraco installation, which we used to Umbraco training. And thinking when I could get the raw xml in XSLT maybe it was possible in Razor too.

    But if this is not possible to do this it's fine. The question just came to me when I was playing with training installation of Umbraco, and because I have an XSLT background.

    I am using Umbraco 4.11.3, and I use webforms, and macroscript based Razor.

    /Dennis


  • Charles Afford 1163 posts 1709 karma points
    Feb 10, 2013 @ 12:27
    Charles Afford
    0

    Hi, i think Umbraco.Core.Models.IPublishedContent is the extension you need.

    I think its something like @Model.Content and then you will have access to all the nice helper methods.

    Charlie :)

Please Sign in or register to post replies

Write your reply to:

Draft