Skip to content

Fix: filter clear url #273

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

Merged
merged 4 commits into from
May 20, 2025
Merged

Fix: filter clear url #273

merged 4 commits into from
May 20, 2025

Conversation

ah-net
Copy link
Collaborator

@ah-net ah-net commented Apr 23, 2025

This pull request fixes an issue with the clear/remove filter url when using an alp with the same url as the selected filter.

How to reproduce

  • Enable ajax navigation
  • Use seo path slugs for url strategy
  • Make an alp with the same url as an filter + value as part of the url. For example: /merken/4-seasons-outdoor-tuinmeubelen/4-seasons-outdoor-capalbio. This url contains the name of the filter /merken/4-seasons-outdoor.
  • When selecting the filter you get an url like: merken/4-seasons-outdoor-tuinmeubelen/4-seasons-outdoor-capalbio/merken/4-seasons-outdoor/
  • Go remove the filter or click on the clear all filters button.
  • See that the url is not /merken/4-seasons-outdoor-tuinmeubelen/4-seasons-outdoor-capalbio but /-tuinmeubelen/4-seasons-outdoor-capalbio

Because the url contains the filter + value it gets removed. This pull request fixes that. The url part is only removed if it ends with an slash. Or with nothing.

@ah-net ah-net requested a review from jansentjeu April 23, 2025 11:36
@ah-net ah-net requested a review from jansentjeu May 20, 2025 12:46
@ah-net ah-net merged commit da2a89f into beta May 20, 2025
1 of 4 checks passed
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.

2 participants