Make configurable adding reset link to the beginning or end of facet item list

Created on 18 May 2020, almost 5 years ago
Updated 11 March 2025, 23 days ago

Problem/Motivation

Currently the reset_facets plugin adds it extra reset link to the beginning of the array in class processor/ResetFacetsProcessor at line 77. Unfortunately this is not always the desired look for all application and it's quite hard to handle on Twig-level as all <li> elements (including facet items and this reset link) arrives in one single variable.

Proposed resolution

However, it could be relatively easy to make configurable to switch between using the current array_unshift() or its opposite array_push() when adding reset link to the array of facet items. I can imagine creating a new, boolean type configuration value editable on plugin's config form to make users able to control which end of the list they want the reset link to appear.

Remaining tasks

If module maintainers' response is positive to this feature request, then I'm open to craft a patch for review and testing.

User interface changes

Config form of "Reset link" plugin would extend with a pair of radio buttons offering site admins with two options

  • "Before facet items"
  • "After facet items"

Prior one would remain selected by default.

API changes

n/a

Data model changes

Sub-module's config schema needs to be updated to describe the new config value.

Release notes snippet

A minor, but new feature would be added to the module.

Original report by [username]

n/a

Feature request
Status

Closed: outdated

Version

1.4

Component

Facet summary

Created by

🇭🇺Hungary Balu Ertl Budapest 🇪🇺

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024