Dynamic filter for collections

Created on 31 October 2024, 15 days ago

Problem/Motivation

In a project I’m working on, we had a requirement to implement a dynamic filter for collections that updates instantly and reflects the latest data. I’m not sure if this will be useful for others, but I’m sharing my approach in case it might help. I’m open to any suggestions or feedback.

Summary

After reviewing the Widen API documentation (Collections API Reference), examining the module’s functionality, and finding the search prefix acn:(), I decided to build on the existing module to handle this as a feature.

Implementation Details

Method Addition in AcquiaDamClient:
I created a new function, getCollections, in the AcquiaDamClient class. This function retrieves the latest list of collections from the Widen API, ensuring the data is up-to-date.

CollectionFilter Plugin: I added a CollectionFilter filter plugin that dynamically fills filter options in getValueOptions directly from getCollections. This approach ensures that the filter options are always current, meeting our project’s requirement for real-time updates.

Feature request
Status

Active

Version

1.1

Component

Code

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024