Copied to clipboard

Flag this post as spam?

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


  • Peng 3 posts 33 karma points
    Jun 13, 2014 @ 23:12
    Peng
    0

    How to exclude certain document type from the search result?

    Hi, 

    We use XSLTSearch Version 3.0.4. There is a bug we found in our application. The search results shows the widgets that created by us. And once the link is clicked, the error page shows up since it is not a real page. It is just a widget on the page. 

    Please help me to exclude this document type or macro type from the search criteria so that it does not show on the search results.

     

    Thanks a lot,

    Pdong

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Jun 13, 2014 @ 23:27
    Dennis Aaen
    102

    Hi Peng and welcome to our,

    I think I found something that you help you to solve your issue. Have a look at the forum thead with the same subject.

    http://our.umbraco.org/forum/developers/xslt/3629-exclude-document-type-from-xsltsearch

    Doug also written a blogpost about how to customizing xsltsearch for specific needs. This blogpost can be found here: http://blog.percipientstudios.com/2009/4/7/customizing-xsltsearch.aspx

    Hope this helps you,

    /Dennis

  • Chriztian Steinmeier 2798 posts 8787 karma points MVP 7x admin c-trib
    Jun 13, 2014 @ 23:27
    Chriztian Steinmeier
    1

    Hi Pdong,

    You need to find the lines that look like this:

    <!-- reduce the number of nodes for applying all the functions in the next step -->
        <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 then add a filter for your specific DocumentType aliases, e.g. if you need to hide a specific type:

    <!-- reduce the number of nodes for applying all the functions in the next step -->
    <xsl:variable name="possibleNodes" select="$items/descendant-or-self::*
        [@isDoc and not(self::WidgetTypeAlias)]
        [not(umbracoNaviHide = 1)]
        [
            umbraco.library:IsProtected(@id, @path) = false()
            or umbraco.library:HasAccess(@id, @path) = true()
        ]
    ]"/>
    

    /Chriztian

  • Peng 3 posts 33 karma points
    Jun 14, 2014 @ 00:21
    Peng
    0

    Thanks a lot guys! I did find the old posts and resolved it by following the posts!

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Jun 14, 2014 @ 12:08
    Dennis Aaen
    0

    Hi Peng,

    Awesome that you managed to get it work.

    I think that you should mark this topic as solved so other people how gets the same question can see what worked for you, and go directly to the solution. Since you are new to our I can explain to you how you can mark a question as solved. it.

    For each post you have a green tick, so to mark the question as solved you just find the post that gives you the correct answer, to solve your problem and just clik this little green tick on that post. Be aware that you only can mark one post as the correct answer to your question.

    /Dennis

  • Peng 3 posts 33 karma points
    Jun 16, 2014 @ 16:25
    Peng
    0

    Thank Dennis, I just selected your post as a solution. :-)

     

Please Sign in or register to post replies

Write your reply to:

Draft