Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support for the facets_form module #399

Merged
merged 5 commits into from
Oct 12, 2024

Conversation

Adnan-cds
Copy link
Contributor

While rendering the facets_form_checkbox facet widget provided by the facets_form module, this change groups facet checkboxes according to their LocalGov Directory facet type. This is similar to how the existing checkbox facet widget is rendered for LocalGov Directory facets.

Resolves #326. Replaces #398

What does this change?

Adds support for the facets_form module.

How to test

  • Install the facets_form module.
  • Edit the localgov_directories_facets facet from /admin/config/search/facets/localgov_directories_facets/edit
  • Select the Checkboxes (inside form) widget near the top of the page and save settings.
  • From the block layout page at /admin/structure/block, place the Facet form: View Directory channel, display Embed block in a sidebar.
  • [Optional] Disable the existing facet block from the block layout page at /admin/structure/block.
  • Open an existing directory channel page and filter results using the facet checkboxes.

Note: The only way to reset all the facet checkboxes is to click the Reset button. Manually unchecking all facet checkboxes followed by a form submission does not work.

How can we measure success?

Usual appearance and behaviour expected for LocalGov Directory facets. Facets should work even without Javascript as we are no longer relying on Javascript to render the checkboxes. The hidden anchor tags with facet links are also not needed. This stops crawlers from following these anchor tags and then getting stuck in a rabbit hole.

While rendering the facets_form_checkboxes facet widget provided by the
facets_form module, groups facet checkboxes according to their LocalGov
Directory facet type.  This is similar to how the existing `checkbox` facet
widget is rendered for LocalGov Directory facets.

Resolves #326
Facet checkboxes are provided by the facets_form contrib module.
@Adnan-cds Adnan-cds marked this pull request as ready for review October 2, 2024 16:52
@Polynya
Copy link

Polynya commented Oct 9, 2024

Thanks @Adnan-cds, this works for me.

The patch here resolves the issue with unchecking all the checkboxes.
https://www.drupal.org/node/3255007

@Adnan-cds
Copy link
Contributor Author

Many thanks for testing this Adrian :)

Copy link
Contributor

@andybroomfield andybroomfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have also tested this in a default localgov drupal install and with BHCC code base.
Can confirm I do see the facets checkboxes, although it is unstyled which I assume is a theme issue? Maybe could provide a facets form template either here or through localgov_base.

Screenshot 2024-10-10 at 7 17 17 PM Screenshot 2024-10-10 at 7 41 56 PM

@Adnan-cds
Copy link
Contributor Author

although it is unstyled which I assume is a theme issue? Maybe could provide a facets form template either here or through localgov_base.

Hi Andy, thanks for testing and approving. There is a new template for the facet checkboxes but, yes, it is unstyled. Given that this pull request introduces an optional feature which won't immediately effect any existing site, should I raise a new ticket to style it? I have to say I am undecided if the Front-end code should go into this repo or localgov_base :)

@andybroomfield
Copy link
Contributor

@Adnan-cds I'd do it on a new branch. I think it might need to be in localgov_base as it will need the same classes as the checkboxes.

@Adnan-cds
Copy link
Contributor Author

Okay Andy, I will raise a ticket in localgov_base and leave it to Chris or Mark.

@Adnan-cds Adnan-cds merged commit 4aaa6e6 into 3.x Oct 12, 2024
8 checks passed
@Adnan-cds
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support facets form
3 participants