Excluding pages from search results

I’m using the search extension and the Radiant 0.6.3 gem. I see that
I can set it to exclude pages like /sitemap/,/feed/ etc. and that
works fine.

Now I decided to exclude a whole section of my site. I tried adding
the top level page of the section I want to exclude like /section-
name/,/sitemap/ etc but it appears this mechanism is only for
individual pages. So, I tried this on my search results page:

 ...
   <r:unless_content part="no-search">
   <r:search:results>
     <ul>
       <r:search:results:each><li><r:link/></li></

r:search:results:each>

</r:search:results>
</r:unless_content>

and then added a no-search page part to some pages and cleared the
page cache, but those pages still appear in the results.

Is this problem a limitation in the current search extension or am I
just missing something obvious?

thanks,
john

john wrote:

   <r:unless_content part="no-search">

page cache, but those pages still appear in the results.

Is this problem a limitation in the current search extension or am I
just missing something obvious?

thanks,
john

Hi John,

Haven’t used the search extension, so I may be completely off.

But, shouldn’t the unless_content come inside search:results:each ?
That’s how I exclude pages from showing up in the menu (that’s just a
r:children:each…)

<r:children:each by=“published_at” order=“desc” status=“published”>
<r:unless_content part=“no_menu”>

  • <r:link
    />
  • </r:unless_content>
    </r:children:each>

    Cheers,
    Mohit.
    11/11/2007 | 2:36 AM.

    On Nov 10, 2007, at 11:38 AM, Mohit S. wrote:

    shouldn’t the unless_content come inside search:results:each ?

    That works perfectly. Thanks for the tip, I’m still on the upside of
    the radius learning curve.

    thanks,
    john

    john wrote:

    On Nov 10, 2007, at 11:38 AM, Mohit S. wrote:

    shouldn’t the unless_content come inside search:results:each ?

    That works perfectly. Thanks for the tip, I’m still on the upside of
    the radius learning curve.

    thanks,
    john

    Hi John

    You’re most welcome!

    That’s the thing with Radius tags. I guess it does help to get a bit
    acquainted with Radius (or learn as you go along - as I ended up doing
    it).

    The simple rule that pulls me through - when you do something like an
    :each, it switches the context of the tag to the item being referred to.

    Since you wanted to check if the result page had a no-search page part,
    you need to switch the context to that page. Hence, the need to do
    search:results:each first - roughly translates to:

    for each item in the search pages
    unless it has a no-search part
    show a link to it
    end unless
    end for

    I’m rambling cos it’s late - glad to have been of help.

    Cheers,
    Mohit.
    11/11/2007 | 3:22 AM.