Copied to clipboard

Flag this post as spam?

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


  • Niklas Hjelm 104 posts 125 karma points
    May 27, 2011 @ 16:54
    Niklas Hjelm
    0

    Two questions

    Hi everyone

    I have two questions.

    First. I know it's possible to exlude pages in the search result using for example umbraconavihide, however I already have a few hundred pages which I don't want to update one by one. These pages are datacontainer pages with no template. Is it possible to something like "exlude pages where template is null?"

    Second. I'm using the latest version. Is there suppose to be no querystring in the url with the searchquery? I know it works in version 2.8. Could be me stripping it, just wanted to check if it's suppose to be there?

    Thanks and have a nice weekend!

    / Niklas

     

  • Douglas Robar 3570 posts 4671 karma points MVP 6x admin c-trib
    May 27, 2011 @ 17:06
    Douglas Robar
    0

    Hi, Niklas,

    You can use either post or get for XSLTsearch forms. If you use <form action="get"...> then you'll see querystrings and if <form action="post" ...> then you won't.

    As for excluding pages without templates... find the only reference to umbracoNaviHide in the xsltsearch.xslt file and add a check to exclude pages without a template. The following should do it:

        <!-- 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 @template != '0'
                                 and count(attribute::id)=1 
                                 and (umbraco.library:IsProtected(@id, @path) = false()
                                  or umbraco.library:HasAccess(@id, @path) = true())
                               ]"/>
    

    cheers,
    doug.

  • Niklas Hjelm 104 posts 125 karma points
    May 30, 2011 @ 11:02
    Niklas Hjelm
    0

    Thanks Doug!

    Works perfect. Nice product!

    Cheers / Niklas

Please Sign in or register to post replies

Write your reply to:

Draft