Copied to clipboard

Flag this post as spam?

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


  • Carlos 338 posts 472 karma points
    Dec 22, 2011 @ 19:19
    Carlos
    0

    XSLT, Content Picker, get Properties

    I am using the content picker to choose a content page from another page in the content tree.

    In my XSLT I am trying to get a property from my chosen Node I chose from my content picker.

    I am able to output the ID of the node by using

    <xsl:value-of select="umbraco.library:GetXmlNodeCurrent()/courseClassroomResource"/>

    I set up some custom properties that I would like to pull from the node. Like... "My Page Title".

    I thought I would be able to get my property by doing

    <xsl:value-of select="umbraco.library:GetXmlNodeCurrent()/courseClassroomResource/myPageTitle"/>

     

    But this outputs nothing on the page.  

    Does anyone have any ideas why this may be happening or can anyone point me in the right direction?

    Thanks.

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Dec 22, 2011 @ 19:35
    Tom Fulton
    0

    Hi,

    Here's how you should do it, using umbraco.library:GetXmlNodeById:

    <xsl:variable name="pickedPage" select="umbraco.library:GetXmlNodeById(courseClassroomResource)" />
    <xsl:if test="not($pickedPage/error)"> <!-- make sure the page still exist -->
      Name of picked page:  <xsl:value-of select="$pickedPage/@nodeName"/>
      And whatever other properties... <xsl:value-of select="$pickedPage/someProperty" />
    </xsl:if>

    -Tom

  • 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