Copied to clipboard

Flag this post as spam?

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


  • Amir Khan 1289 posts 2746 karma points
    Jul 20, 2009 @ 20:42
    Amir Khan
    0

    Getting text from field into xslt

    I have the following code to get children of a parent, where the parent is selected by id.


    How could I make it so that I can also get some text from one of the parent's tabs and put it in the <li></li> also?

     

    <xsl:variable name="source" select="1155"/>

    <xsl:template match="/">

    <ul>
    <xsl:for-each select="umbraco.library:GetXmlNodeById($source)/node [string(data [@alias='umbracoNaviHide']) != '1']">
        <li>
            <a href="{umbraco.library:NiceUrl(@id)}">

                <xsl:value-of select="@nodeName"/>

            </a>
        </li>
    </xsl:for-each>
    </ul>

    </xsl:template>

  • Amir Khan 1289 posts 2746 karma points
    Jul 20, 2009 @ 20:47
    Amir Khan
    0

    Got it!

     

    <xsl:value-of select="data[@alias= 'FIELDNAMEHERE']" />

  • Ron Brouwer 273 posts 768 karma points
    Jul 20, 2009 @ 20:49
    Ron Brouwer
    0

    Hi Amir,

    You can use <xsl:value-of select="../@nodeName"/> to get something of the parent but you need to be more specific of what you would like to select.

    Ron

  • 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