Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Actually we can only render a facet based on Date with a html list. This is a little ugly if we want display this Date facet beside other facets, based on taxonomy term for example, which are rendered with the DropDown Widget
It would be nice if we could have an option on the DateBasicWidget to render the actual list of link as the Dropdown widget do. Let's me know if this make sens for you ? I can work on it and try to provide a patch.
Thanks
Comments
Comment #2
flocondetoileA first attempt to demo the feature
Comment #3
flocondetoileComment #4
flocondetoileForgot to change the label
Comment #5
borisson_Overall this looks great, we need to write a javascript test for it though. Thanks!
This should probably also run trough a
t
method?Comment #6
borisson_Back to NW for tests + small change
Comment #7
flocondetoileRe #5.
In fact this default option label is an user input, so this string must be translated from the translate UI (admin/config/search/facets/FACET_NAME/edit/translate/LANGUAGE/add).
But I noticed that this widget do not have a schema so actually we can not translate the label as we can for the dropdown widget.
Comment #8
flocondetoileWill add too the corresponding schema in the next iteration.
Comment #9
flocondetoilePatch reroll against HEAD + config schema added for datebasic widget. Default Label option is now translatable.
Back to need review for launching existing test, but still missing corresponding JavascriptTest.
I am not yet "comfortable" with JavascriptTest and I will try soon.
Comment #11
flocondetoileRelaunch failing tests
Comment #12
flocondetoileRelaunch tests with same patch #9
Comment #14
borisson_So the current tests are green, but we need to add test-coverage for this as well.
Comment #15
joachim CreditAttribution: joachim at Torchbox commentedI think this is the wrong way to fix this. This means we have to add options to the date widget for all the other widgets -- list, dropdown, checkboxes. In the future, when other data types need special handling, the problem gets worse.
I've proposed an alternative at #2896229: move date handling to a processor, so date facets can use existing widgets.
Comment #16
borisson_Closing this issue in favor of the other suggestion.
This approach would lead to a ton of duplication and make the module harder to maintain - we're actively trying to avoid that.
Thanks for your work on this issue though @flocondetoile!