- Issue created by @Ricardo García
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.
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.
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.
Active
1.1
Code