Copied to clipboard

Flag this post as spam?

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


  • rajeev 18 posts 38 karma points
    Feb 22, 2011 @ 12:37
    rajeev
    0

    How to get node property in umbraco 4.6.1

    <xsl:value-of select="$currentPage/descendant::node[@nodeTypeAlias='product']/@id"/>

    return nothing on the root node in umbraco version 4.6.1

    I think this issue is becouse of the version.

    Please suggest me what would be change in above xslt  to get the product node property

    Structure

    Home

             Product

            News

     

     

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Feb 22, 2011 @ 12:46
    Chriztian Steinmeier
    1

    Hi rajeev,

    The new XML Schema (search for it here on Our) is a lot simpler - your snippet looks like this:

    <xsl:value-of select="$currentPage/descendant::product[@isDoc]/@id" />

    Make sure to get the casing right - if the alias is "Product" you need to use that

    /Chriztian

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Feb 22, 2011 @ 12:49
    Jan Skovgaard
    1

    Hi Rajeev

    That's because the sample you're using is for the legacy XML schema. (Since v4.5 of Umbraco the XML schema has changed - the syntax you're using is pre v.4.5)

    To see the XML structure you're trying to match make a copy-of like this

    <textarea>

    <xsl:copy-of select="$currentPage/descendant::*[@isDoc]" />

    </textarea>

    This should give you a notion of the structure.

    In the sample I think you could actually do something like this since you only want the specific document type of "product", right?

    <xsl:value-of select="$currentPage/product/@id />

    Does this help?

    /Jan

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Feb 22, 2011 @ 12:49
    Jan Skovgaard
    0

    Beaten by the majestro once again, you rock Chriztian ;-)

    /Jan

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Feb 22, 2011 @ 12:58
    Chriztian Steinmeier
    0

    Your explanation was more detailed, though - I just opted for the close-to-LMGTFY solution :-)

    /Chriztian

    PS: With your current karma-score I wouldn't necessarily call it "beaten" either... :-)

  • rajeev 18 posts 38 karma points
    Feb 26, 2011 @ 02:46
    rajeev
    0

    Thanks for everyone. Both solutions of Crhiztian and  Jan were very helipful for me.

  • 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