Support facets 3.x facets exposed filters

Created on 10 February 2025, about 1 month ago

Problem/Motivation

I would like to move to the facets 3.x exposed filters system while maintaining facets-pretty-paths-provided paths.

After evaluating the Views Pretty Paths module β†’ , I believe this is possible, but may be more straightforward if implemented here in Facets Pretty Paths due to the more polished routing strategy, existing integration with facets system and config, and more mature coder system and coders.

Steps to reproduce

N/A.

Proposed resolution

Expand support to facets exposed filters (views filter plugins of type "facets_filter"), probably offering the standard pretty paths config in the views exposed filter config (alongside the other facet config already there).

On incoming view + exposed filter query request (eg. "/view?category=258"), encode and redirect to the pretty path (eg. "/view/category/foo-258"). This should allow the pretty path to overtake the standard exposed filters path.

On incoming pretty path request, inject query params for any facets exposed filters into the current request object so the view can harvest them. No need to actually filter / apply anything at this stage because the view + facets exposed filters will handle this given the query parameter data.

Remaining tasks

- Agreement that facets exposed filters support should come to this module (as opposed to Views Pretty Paths)
- Agreement on proposed resolution
- MR
- Review

User interface changes

Ability to configure pretty paths for facets exposed filters.

API changes

None?

Data model changes

Becomes inclusive of views filter plugins of type "facets_filter" in addition to config entities of type "facets_facet".

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States chrisolof

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @chrisolof
  • πŸ‡ΊπŸ‡ΈUnited States chrisolof

    Support added in the 3505618-support-facets-exposed-filters branch. Tested against a variety of facet filters with a variety of employed coders, single and multi-value selections. Seems to be working well at this point.

    Pretty paths coder config is at the filter-level (it shows in the exposed filter options form). It is possible to combine pretty and regular query string facet filters (eg. "/view/category/foo-258?tag=33).

    Filter order in the URL is currently just following the filter order already established in the view.

    Still needs test coverage and likely some additional refinement - both hopefully coming in this week.

  • Merge request !20Add support for facets exposed filters β†’ (Open) created by chrisolof
  • Pipeline finished with Success
    22 days ago
    Total: 306s
    #430193
  • Pipeline finished with Success
    22 days ago
    Total: 303s
    #430204
  • πŸ‡ΊπŸ‡ΈUnited States chrisolof

    Test coverage and small improvements added (some identified while adding the test coverage). This is now ready for review.

    Attached is an immutable patch against 2.0.x representing the current state of the MR 20.

Production build 0.71.5 2024