Drupal is a registered trademark of Dries Buytaert

Facets Attachment Display extends Drupal's search capabilities by allowing Views attachment displays to be used as facet sources. While standard Drupal setups only allow facets to be associated with main Views displays (pages, blocks), this module enables you to add facets to search results displayed through Views attachments, creating more flexible and powerful search interfaces.

Features

  • Enables Views attachment displays as valid facet sources in the Search API ecosystem
  • Allows independent filtering of attachment display results using facets
  • Seamlessly integrates with existing Search API and Facets infrastructure
  • Supports complex search interfaces with multiple result sections
  • Maintains the same familiar facet configuration workflow
  • Works with any Search API backend (Solr, Database, Elasticsearch, etc.)

Post-Installation

After installing the module:

  1. Create or edit a View that uses a Search API index as its base
  2. Set up a main display (page, block) and add an attachment display to it
  3. Configure both displays to use the Search API query type
  4. Go to the Facets administration page (/admin/config/search/facets) and click "Add facet"
  5. In the "Facet source" dropdown, you'll now see your attachment display listed as "Views attachment: [view_name]__[display_id]"
  6. Select this facet source and configure your facet as needed
  7. Place the facet block in your desired region

No additional configuration is required at the module level - it works automatically once enabled.

Additional Requirements

  • Drupal core 11.x
  • Search API module
  • Facets module
  • Views module (included in Drupal core)

Similar projects

While several modules extend Facets functionality, Facets Attachment Display is unique in its focus on Views attachment displays. The core Facets module supports regular Views displays, but not attachments. This module fills that specific gap in the Search API ecosystem.

  • Issue Queue Issue queue
  • Additional Information

    Technical Implementation

    The module works by registering a new Search API display plugin type (views_attachment) and implementing hooks to detect when a Views attachment display is being rendered. It then registers the attachment as a Search API display if it's attached to a display that uses Search API.

    Troubleshooting

    If your attachment display is not appearing as a facet source:

    • Ensure both the parent display and the attachment display use the Search API query type
    • Verify that the attachment display is properly configured to be attached to a main display
    • Clear the Drupal cache to ensure all plugin definitions are refreshed

    Activity

    Total releases
    2
    First release
    Mar 2025
    Latest release
    11 months ago
    Release cadence
    0 days
    Stability
    0% stable

    Releases

    Version Type Release date
    11.0.0-alpha1 Pre-release Mar 10, 2025
    11.x-dev Dev Mar 10, 2025