Skip to main content

collective.searchblocks

A comprehensive Plone add-on that provides search functionality for content using specific blocks.

Features ✨

  • Block Search Endpoint: RESTful API endpoint (/@search-blocks) for searching content by block types
  • Security: Permission-based access control for the search API
  • User menu link: A collective-searchblocks user action, listed only to the users with the collective.searchblocks: Search Blocks permission, that Volto shows in the toolbar user menu
  • Catalog Integration: Uses Plone's catalog for efficient searching
  • Metadata Support: Returns rich metadata including title, type, review state, creation and modification dates
  • Pagination: Support for batched results with configurable page sizes
  • Sorting: Results sorted by title for consistent ordering

Installation

Install collective.searchblocks with uv.

uv add collective.searchblocks

Create the Plone site.

make create-site

REST API

@search-blocks

Search for content using specific blocks.

GET /@search-blocks

Returns a list of all available block types in the catalog.

Response:

{
  "block_types": ["slider", "hero", "text"]
}

GET /@search-blocks?block_types=slider

Returns content items that have the specified block type, formatted using the standard summary serializer.

Response:

{
  "block_types": ["slider", "hero", "text"],
  "items": [
    {
      "@id": "http://localhost:8080/Plone/doc-1",
      "@type": "Document",
      "title": "Doc 1",
      "description": "...",
      "review_state": "published"
    }
  ],
  "items_total": 1
}

Parameters:

  • block_types (string): The block type to search for.
  • b_size (int): Batch size (pagination).
  • b_start (int): Batch start index (pagination).
  • sort_on (string, automatic): Sorts results by sortable_title (automatically added).
  • metadata_fields (list, automatic): Includes modified and created metadata fields (automatically added).

Contribute

Prerequisites ✅

Installation 🔧

  1. Clone this repository.

    git clone git@github.com:collective/collective-searchblocks.git
    cd collective-searchblocks/backend
    
  2. Install this code base.

    make install
    

Add features using plonecli or bobtemplates.plone

This package provides markers as strings (<!-- extra stuff goes here -->) that are compatible with plonecli and bobtemplates.plone. These markers act as hooks to add all kinds of features through subtemplates, including behaviors, control panels, upgrade steps, or other subtemplates from bobtemplates.plone. plonecli is a command line client for bobtemplates.plone, adding autocompletion and other features.

To add a feature as a subtemplate to your package, use the following command pattern.

make add <template_name>

For example, you can add a content type to your package with the following command.

make add content_type

You can add a behavior with the following command.

make add behavior
You can check the list of available subtemplates in the [`bobtemplates.plone` `README.md` file](https://github.com/plone/bobtemplates.plone/?tab=readme-ov-file#provided-subtemplates).
See also the documentation of [Mockup and Patternslib](https://6.docs.plone.org/classic-ui/mockup.html) for how to build the UI toolkit for Classic UI.

License

The project is licensed under GPLv2.

Credits and acknowledgements 🙏

Generated from the cookieplone-templates template on 2026-01-14 14:29:54.. A special thanks to all contributors and supporters!

Metadata

Release files for collective.searchblocks 0.4.2

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.searchblocks 0.4.2
File Size Uploaded Provenance
collective_searchblocks-0.4.2.tar.gz 77.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for collective.searchblocks 0.4.2
File Interpreter ABI Platform
collective_searchblocks-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 163.4 kB

Release files / collective_searchblocks-0.4.2.tar.gz

Download URL collective_searchblocks-0.4.2.tar.gz
Size 77.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a587d7c6ac454b8942192df969682b6b10083fd9f31cb86e915dabe6695c0f64
BLAKE2b-256 checksum
How to use checksums
8f374a4bdc1da9327ef14493ca0923a24a101bd0baaab473b69a5bdc52f8a7e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / collective_searchblocks-0.4.2-py3-none-any.whl

Download URL collective_searchblocks-0.4.2-py3-none-any.whl
Size 85.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
17316a2b50d2325a13df280667f993197c965d2bcadbd5ae6c10d06299881c84
BLAKE2b-256 checksum
How to use checksums
2f6e7feedb535f1356d51b012704091e9c95c1a05dd750838f47393ba3423b29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for collective.searchblocks 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files No provenance

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