Skip to main content

collective.collectionfilter

CI Meta

Faceted navigation filter for collection or contentlisting tiles.

Filter listing results for any catalog-indexed field — subjects, authors, portal types, and more. The available filter types can be extended (see collective.collectionfilter.vocabularies).

There are five portlets/tiles available:

  • Collection Filter — filter by values (select, radio, checkbox, link)
  • Collection Search — fulltext search (SearchableText) on collection results
  • Collection Maps — a LeafletJS map that shows and filters IGeolocatable items (requires collective.geolocationbehavior, see below)
  • Collection Result Listing Sort — let users sort the filtered results
  • Collection Filter Reset — reset all active filters

Filtering collections

Add filter/search portlets directly to a collection. Selecting filter values reloads results asynchronously (no page refresh) via AJAX.

If your theme or view template needs customization for AJAX loading, adjust the Content Selector and/or View Template settings. Make sure the selector exists on both the source collection template and the target page.

Filters can also target a remote collection — specify a target collection in the portlet/tile settings. Without AJAX, selecting a filter option redirects to the collection.

Mosaic integration

Install the extra:

pip install collective.collectionfilter[mosaic]

Add filter tiles via the Mosaic Insert menu and assign a collection. Use a Content Listing tile to display results.

Multiple content listings and filters can coexist on the same page — use unique CSS classes in the listing tile settings and reference them in the filter tile's Content Selector.

Geolocation support

Install the extra:

pip install collective.collectionfilter[geolocation]

This provides a LeafletJS map tile/portlet showing IGeolocatable collection items. Enable Narrow down results to filter the collection and other tiles when the user pans or zooms the map.

Customizing GroupByCriteria

GroupByCriteria is a global utility that defines which catalog indexes are available as filter criteria.

Each index entry has this structure:

{
    'index': 'Subject',              # catalog index name
    'metadata': 'Subject',           # metadata column name
    'display_modifier': _,           # callable(value, index) -> display string
    'index_modifier': None,          # callable to transform search values
    'value_blacklist': [],           # values to exclude (list or callable)
    'sort_key_function': lambda it: it['title'].lower(),
}

To customize, register an IGroupByModifier adapter:

from collective.collectionfilter.interfaces import IGroupByCriteria
from collective.collectionfilter.interfaces import IGroupByModifier
from zope.component import adapter
from zope.interface import implementer


@implementer(IGroupByModifier)
@adapter(IGroupByCriteria)
def groupby_modifier(groupby):
    groupby._groupby['Subject']['display_modifier'] = lambda x, idx: x.upper()
    groupby._groupby['my_custom_index'] = {
        'index': 'my_custom_index',
        'metadata': 'my_custom_metadata',
        'display_modifier': lambda val, idx: f'Custom: {val}',
    }
<configure xmlns="http://namespaces.zope.org/zope">
  <adapter factory=".mymodule.groupby_modifier" name="my_modifier" />
</configure>

The adapter is called by GroupByCriteria.groupby. Modify the _groupby dict (not the groupby property, which triggers adapter lookup).

Compatibility

  • Version 6.x — Plone 6.2+
  • Version 5.x — Plone 6.0+
  • Version 4.x — Plone 5.2
  • Version 3.x — Plone 5.0/5.1

If AJAX loading doesn't work with your theme, disable it in the registry or override via diazo.

Authors

  • Johannes Raggam
  • Peter Holzer

Based on collective.portlet.collectionfilter and collective.portlet.collectionbysubject.

Release files for collective.collectionfilter 6.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.collectionfilter 6.0.0
File Size Uploaded
collective_collectionfilter-6.0.0.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for collective.collectionfilter 6.0.0
File Interpreter ABI Platform
collective_collectionfilter-6.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.2 MB

Release files / collective_collectionfilter-6.0.0.tar.gz

Download URL collective_collectionfilter-6.0.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
a1f2a9bf9001e3151f1bd3a054f0e2966cb76975c22853698616f168122fba8d
BLAKE2b-256 checksum
How to use checksums
f62d8f45fad5775e48376060c68634ecb266dd9956bc55e13ef57fc231b8b023
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / collective_collectionfilter-6.0.0-py3-none-any.whl

Download URL collective_collectionfilter-6.0.0-py3-none-any.whl
Size 2.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
865bf9b19b9d6cf72118245737337bf481f5de7cd196a0034c3cf4e2e9db9358
BLAKE2b-256 checksum
How to use checksums
3a55b1561923975c61ff9c858988fc8c7906b8e7509e3b5f63b8e7c5a307de7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

This release

6.0.0 This release

2 release files

5.3.1

2 release files

5.3.0

2 release files

5.2.2

2 release files

5.2.1

2 release files

5.2.0

2 release files

5.1.1

2 release files

5.1

2 release files

5.0.0

3 release files

4.0

1 release file

3.5.1

1 release file

3.5

1 release file

3.4.2

1 release file

3.4.1

1 release file

3.4

1 release file

3.3

1 release file

3.2.1

1 release file

3.2

1 release file

3.1

1 release file

3.0

1 release file

2.1

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0

1 release file

1.0.1

1 release file

1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page