I have a query loop showing two post types (post and realisation), with a radio Query Filter using a custom URL parameter _type (values post / realisation).
Working as expected:
Using the filter on the page is working just fine. The URL is correctly set as is the active radio state and it filters the loop.
The problem:
If I arrive on the page with a pre-populated URL parameter, e.g., mypage/?_type=realisation, it works, the loop is filtered, and the active state is set on the filter, but then if I use the filter on the page, Bricks appends its value instead of replacing the existing one : ?_type=post&_type=realisation
At that point the filter breaks (wrong state, loop no longer filters correctly), since PHP only keeps the last occurrence while the filter state desyncs.
Is this a known limitation when pre-setting a filter’s custom URL parameter via a direct link? Is there a supported way to deep-link to a pre-filtered state without causing the duplication on the next filter interaction?
Unfortunately, I cannot reproduce the issue with the current version (2.3.9). Would you be so kind as to provide a live link and a screencast using https://jam.dev showing and explaining what’s happening?
Best regards,
timmse
Ps: These are my filter settings (as basic as they can be):
I checked the URL and noticed that the page currently has two filters connected to the same query using the same URL parameter _type: one Radio filter and one Select filter.
Even if one of them is only used for a different responsive layout and visually hidden, both filter elements are still present in the DOM and can be initialized by Bricks. When the page is opened with ?_type=post, both controls can represent that same selected URL state. Changing one of them can then result in multiple values being serialized for the same _type parameter.
Please test again with only one _type filter present on the page.
It’s not great news for my mobile filter, though. I could make it “work“ using OS conditions, but that’s going to cause way more headaches than necessary, and radio buttons work well enough on mobile