Copied to clipboard

Flag this post as spam?

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


  • Djan Blom 99 posts 161 karma points
    Aug 18, 2011 @ 15:46
    Djan Blom
    0

    XSLTsearch returning hidden pages

    Hi all,

    Im using umbraco version 4.7 and XSLTsearch 3.0 - and have installed it on my website here : http://omniscience.dk/

    When I use the XSLTsearch, it returns pages that are hidden from sitemap and menu's..

    Can someone help me change the xslt so that it only returns "not-hidden" pages?

    Thanks, Best regards,

    Djan

  • Jacob Jensen 40 posts 60 karma points
    Aug 18, 2011 @ 15:54
    Jacob Jensen
    0

    just edit $possibleNodes to select the nodes u want to search.

    /J

  • Djan Blom 99 posts 161 karma points
    Aug 18, 2011 @ 19:43
    Djan Blom
    0

    Edit what to what? I tried changing (umbracoNaviHide) != '1' to '0' - but that didn't seem to work..

    Could give me a hint ? :)

        
        <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())
                               ]"/>

    Should I just remove the line "and string(umbracoNaviHide) != '1' "?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Aug 22, 2011 @ 11:41
    Douglas Robar
    0

    Hi, Djan,

    There should be no need to modify the possibleNodes variable.

    XSLTsearch specifically does NOT return pages that are hidden (using the 'umbracoNaviHide' alias set to true), nor any pages that the currently logged in member does not have permissions to view. This has always been the behavior of XSLTsearch and the code snippet you showed for the possibleNodes variable indicates exactly this.

    It is a more advanced handling than the default xslt menu and sitemap macros but they share the @isDoc and string(umbracoNaviHide) != '1' code, which is the important part based on your description.

    Can you double-check that the page(s) you wish to hide from the search have the umbracoNaviHide document type alias (it is case-sensitive) and that the page has the true/false checkbox selected? The page should not now appear in the navigation, the sitemap, nor the search results. You might temporarily add the umbracoNaviHide property to a top-level page of your site that appears on your main navigation to to make testing more obvious if you have a large site.

    Let us know what you find out.

    cheers,
    doug. 

Please Sign in or register to post replies

Write your reply to:

Draft