Copied to clipboard

Flag this post as spam?

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


  • praveity 100 posts 125 karma points
    Apr 26, 2011 @ 13:26
    praveity
    0

    XsltSearch: Get the $matchnodes of specific documentTypes only

    Hi to all,

    I have been working with the XsltSearch package. I could see that the variable $matchnodes have @id, @nodeType, @level, @parentID and many othe properties.

    I need to modify it to get the matchnodes of only certain document type.

    I tried: 

    <xsl:when test ="umbraco.library:GetXmlNodeById($matchedNodes/@id)/SC_ServicesPage[@isDoc] ">
    <!--  your code here -->
    </xsl:when>

    This is not working at all. Also I tried to make it like this.

    <xsl:when test ="$matchedNodes/@nodeType = 1193">
    </xsl:when>

    But this will not result in node-set. :)

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Apr 26, 2011 @ 13:42
    Sebastiaan Janssen
    0

    I usually do this at the "possibleNodes" variable, here's an example of one of my sites:

        <xsl:variable name="possibleNodes" select="$items/descendant-or-self::*[
                                 @isDoc
                                 and string(umbracoNaviHide) != '1'
                                 and count(attribute::id)=1 
                                 and (umbraco.library:IsProtected(@id, @path) = false()
                                  or umbraco.library:HasAccess(@id, @path) = true())
                                 and (
                                        local-name() = 'Article'
                                        or local-name() = 'TextPage'
                                    )   
                               ]"/>
  • praveity 100 posts 125 karma points
    Apr 26, 2011 @ 14:01
    praveity
    0

    Hi Sebastiaan, 

    the way you are filtering will result the selection of all nodes that are of type 'Article' or 'TextPage' only. But in my scenario, I have to managed to changed the selection of the different source node to search based on the input radio button. The only thing is that I need is to check if the matchednodes are of "SC_ServicesPage" doctype or not and then make an anchor on it with querystring while for other matched nodes it will be  anchor with no querysting.

     

  • rich hamilton 117 posts 136 karma points
    Apr 12, 2012 @ 14:08
    rich hamilton
    0

    Sebastian, I tried this aswell and it still returned all nodes.

    ?

  • 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