[Zope-CMF] Make folder and contents non-ZCatalog-able

Sam Brauer sampbrauer at yahoo.com
Thu Feb 17 10:17:19 EST 2005


Andrew,
Here's a possible solution:

Add a script to portal_skins called "show_in_search"
that generally returns 1, but has some logic to return
0 for objects that you don't want displayed in search
results.  It's up to you to determine the logic
suitable for your situation.

In portal_catalog, create a FieldIndex named
show_in_search, then update your catalog (using the
button in the catalog's Advanced tab).

Then track down any templates or scripts that do
searches where you want to filter out results, and
customize them adding to the catalog query
"show_in_search":1

If necessary, you can just add that extra condition if
the current user is anonymous (or lacks some
sufficient role), if that makes sense for your use
case.

I've also done things like adding a boolean property
at the site-level that is true, then adding a property
with the same name but a false value to specific
folders, and creating an index on that property and
tweaking my search templates and scripts to use that
index.

Hopefully this will give you some ideas.

- Sam

--- Chris Withers <chris at simplistix.co.uk> wrote:

> Andrew F. Sears wrote:
> 
> > Is there a way to make a folder to be skipped by
> the cataloging process?
> > I have made a folder only viewable to people with
> certain permissions,
> > but I don't want it or its contents to be
> searchable, thus remove it
> > from the catalog.  Is this possible?
> 
> Not really, the CMF relies on zcatalog for a lot of
> its functionality...
> 
> That said, it DOES do some filtering based on
> whether you're allowed to 
> see the object in the search results, which may
> suite your needs...
> 
> Chris
> 
> -- 
> Simplistix - Content Management, Zope & Python
> Consulting
>             - http://www.simplistix.co.uk
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF at lists.zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See http://collector.zope.org/CMF for bug reports
> and feature requests
> 



		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 


More information about the Zope-CMF mailing list