Copied to clipboard

Flag this post as spam?

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


  • CodeMaster2008 151 posts 184 karma points
    Apr 02, 2010 @ 16:55
    CodeMaster2008
    0

    Acessing properties of a document type

    I created a XSLT file using the "List Sub Pages From A Changeble Source" and it's working well.
    On the corresponding macro i have:

    <xsl:variable name="contentNode" select="umbraco.library:GetXmlNodeById($source)"/>
    <div id="features">
       <xsl:for-each select="$contentNode/node [string(data [@alias='umbracoNaviHide']) != '1']">
     <div>
         <xsl:value-of select="umbraco.library:RemoveFirstParagraphTag(data [@alias = 'SlideContent'])" disable-output-escaping="yes"/>
     </div>
       </xsl:for-each>
    </div>

    So, i already have the node that i need in the variable "contentNode", can i access the "generic properties" (the ones i created) from this variable?
    Something like:

    <xsl:value-of select="string(data [@alias = 'contentNode.MyProperty'])" />
  • CodeMaster2008 151 posts 184 karma points
    Apr 02, 2010 @ 17:34
    CodeMaster2008
    0

    I got it:
    <xsl:value-of select="$contentNode/data[@alias = 'width']" />

  • Kim Andersen 1447 posts 2197 karma points MVP
    Apr 02, 2010 @ 20:47
    Kim Andersen
    0

    Hi

    Great that you solved your problem by your self :)

    A good idea is to make a textarea, and print out the source to see what you can access. In your case you could do something like this:

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

    This would give you the XML from $contentNode, and in here you can see which properties you can access.

    /Kim A

  • CodeMaster2008 151 posts 184 karma points
    Apr 02, 2010 @ 21:10
    CodeMaster2008
    0

    It's good to know, thanks a lot.

  • 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