Monday, January 30, 2023
1 change · master
Resolved issues and error corrections
Website navigation now more reliably identifies the current page, including dropdown menu items and links written as full URLs. This improves visitor orientation by highlighting the right menu item while correctly handling query options and ignoring page anchors that cannot be checked by the server.
Original PR description
- `clean_url` method was wrongly flag as `api.model` - the `unslug_url` was not called for the URL comparison in the dropdown case, meaning that `/shop/prod-1` would not match `/shop/product-1` as it should (and as it does for regular non dropdown menu) - the `active` class was actually never working for the dropdown case, as the class was added on the wrong element (`li` instead of `a`) The code was hard to read (mainly because huge python conditions in XML) and kinda redundant, going through an util method should be clearer and help reading the template XML. - Ignore anchors, those are not sent to the server anyway, no way to compare even if we wanted to - Ensure query string (qs) are the same to be considered equals On top of that, it also fixes the case when the user inserted an absolute URL instead of a relative one, it will now match. task-3096367 opw-3091427