Copied to clipboard

Flag this post as spam?

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


  • yumin 51 posts 243 karma points
    Jun 20, 2013 @ 06:02
    yumin
    0

    how to filter node that has been deleted

    My doctype has a attribute related other nodes via mntp, if the related node has been deleted, my xslt does not work, here is my code:

    <xsl:for-each select=".//nodeId[position() &lt;= 6]">
    <xsl:variable name="RelateNode" select="umbraco.library:GetXmlNodeById(.)" />
              <xsl:choose>
                <xsl:when test="$RelateNode/@nodeName !=''">
                  <li>
                      <span>
                        <xsl:value-of select="$RelateNode/@nodeName"/>
                      </span>
                  </li>
                </xsl:when>
              </xsl:choose>
    </xsl:for-each>

    xml data is:

    <MultiNodePicker type="content">
          <nodeId>8535</nodeId> //this nodeId has been deleted,mntp will hide this item
          <nodeId>9721</nodeId>
          <nodeId>9245</nodeId>
          <nodeId>9246</nodeId>
          <nodeId>9249</nodeId>
          <nodeId>9249</nodeId>
          <nodeId>9250</nodeId>
    </MultiNodePicker>

    On the properties tab, people can't see <nodeId>8535</nodeId> item, but in the front page, the list does not show <nodeId>9250</nodeId> item, because list number is 6, for-each from <nodeId>8535</nodeId> to <nodeId>9249</nodeId>, so the valid data <nodeId>9250</nodeId> did not show, how to fix that problem?

    thanks in advance

  • Chriztian Steinmeier 2800 posts 8791 karma points MVP 8x admin c-trib
    Jun 20, 2013 @ 09:18
    Chriztian Steinmeier
    100

    Hi yumin,

    It's a little lengthy but you should check out my post on using the Multi-Node Tree Picker on Pimp My XSLT - it takes an alternate approach and also eliminates the problem with deleted nodes (scroll down to the "What’s the difference between..." box to read the explanation).

    Feel free to drop us any questions you have... 

    /Chriztian

  • yumin 51 posts 243 karma points
    Jun 26, 2013 @ 10:10
    yumin
    0

    thanks Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft