Olivier: add me to the list of happy search_behavior users :)

In regards to a previous issue:

On 12-Jul-06, at 4:58 PM | Jul 12, Oliver Baltzer wrote:
> On 12-Jul-2006 22:21 +0200, Wolfgang Wopperer was heard to say:
>> - Excluding certain pages from search, e.g. virtual pages (404  
>> pages) or
>> xml files (in my case, a Google sitemap). The most elegant solution
>> would be to make the exclusion list configurable, of course.
>
> I planned some sort of filtering as well. Also such that the search  
> page
> itself does not show up in the search.

What I just did with my implementation is change line 192 in  
search_behavior.rb

from this...
       @query_result = pages.delete_if { |p| !p.published? }

to this:
       @query_result = pages.delete_if { |p| !p.published? ||  
p.parts.find_by_name('_unsearchable_') }

Then I add a page part called '_unsearchable_' to any pages I want  
excluded. Kind of ugly, but it works well.

James
_______________________________________________
Radiant mailing list
[email protected]
http://lists.radiantcms.org/mailman/listinfo/radiant

Reply via email to