Hello,
I've added support for Facet API Pretty Paths to AJAX Facets. Well, at least to my version of AJAX Facets. The attached patch adds pretty paths support but also includes the patch from #2066195: Update Facets on Exposed Filter submission. Sorry, this is not really the best way to submit patches, but I figure it's better to post something and get a dialog going then do nothing. Also, maybe if someone else is looking for Exposed filter and Pretty paths support they'll be able to test/contribute somehow.
Anyway, I consider this patch more of a proof of concept. If you like the direction I'm heading with it, maybe we can work on it further? Or you can just take the reins if you are so inclined. Let me know what you think!
Thanks!
drclaw
Comments
Comment #1
eugene.ilyin CreditAttribution: eugene.ilyin commentedLooks like a big refactoring, I will check it at weekends
Comment #2
eugene.ilyin CreditAttribution: eugene.ilyin commentedHello.
Thank you for your work!
But this patch is not compatible with current version. I also added new code and now I cannot just apply this patch. Can you checkout 7.x-2.x version and prepare patch for it please?
Comment #3
eugene.ilyin CreditAttribution: eugene.ilyin commentedComment #4
drclaw CreditAttribution: drclaw commentedHi,
Yeah, no problem. I think there might have been an mistake in that last one anyway. I'll try and create another patch with the new version this week.
drclaw
Comment #5
drclaw CreditAttribution: drclaw commentedOkay, here's another patch that adds pretty paths support to the 2.x branch of ajax_facets.
Additionally, while I was testing, I found that the exposed form support from one of my other patches didn't work when the exposed form was in a block. This patch includes a few minor fixes to accommodate for that as well. Sorry for overloading the patch, but I was working on both things at once. Let me know if anything needs clarification!
Thanks!
drclaw
Comment #6
eugene.ilyin CreditAttribution: eugene.ilyin commentedThank you, I will review it at saturday
Comment #7
drclaw CreditAttribution: drclaw commentedGreat. Thanks for the quick reply!
Comment #8
drclaw CreditAttribution: drclaw commentedSorry, there was a slight error in the last patch. This one's better (I've attached an interdiff - it's a small fix)
Comment #9
eugene.ilyin CreditAttribution: eugene.ilyin commentedHm, I tried to apply this patch. How I should see effect?
Comment #10
drclaw CreditAttribution: drclaw commentedYou'll need to install FacetAPI Pretty Paths and enable it for your index.
Comment #11
eugene.ilyin CreditAttribution: eugene.ilyin commentedAnd ajax facets should use "pretty paths" when I will use link from popup?
Comment #12
drclaw CreditAttribution: drclaw commentedI'm not sure I understand the question...
Comment #13
eugene.ilyin CreditAttribution: eugene.ilyin commentedHow I can see "pretty paths" with ajax facets? Ajax facets can works without paths, only by ajax.
Comment #14
drclaw CreditAttribution: drclaw commentedAh, I see what you mean. Ajax Facets still relies on the query string variables in the path to function properly. However, with pretty paths enabled, that information becomes part of the path itself, not the query string. The patch basically just accounts for that. It takes the pretty path pairs and submits that information in the ajax query. Then, on the server side, we check if pretty paths is enabled and handle the request appropriately.
If you want to see what pretty paths does, try disabling ajax facets and run a couple filters. You'll see what I mean in the path.
Hope this makes sense!
drclaw
Comment #15
eugene.ilyin CreditAttribution: eugene.ilyin commentedWell, I understand. I tryed your patch, but unfortunately I found many problems. For example:
- When I tryed to use two ajax facets on page, facet which I used in second time, will reset value of facet, which I used in first time;
- Direct link from popup is not working (return JSON code);
- Sometimes when I used "ajax facets", I got javascript errors.
Also I don't like that conditions for "pretty paths" permeate through the module, almost all files.
I do not want to overload too much the code of module "Ajax facets." Perhaps need to looking for a better way. Now I'm not going to add this functionality to the module.
I hope you're not too disappointed with my decision.
Comment #16
eugene.ilyin CreditAttribution: eugene.ilyin commentedComment #17
monstrfolk CreditAttribution: monstrfolk commentedAny plans to support this soon?
Comment #18
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and commented@monstrfolk
Hi, unfortunately I'm pretty busy in last time. I don't think that it will be done in soon time
Comment #19
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and commentedPostponed for 8.x-1.x version
Comment #20
salaikrishnan CreditAttribution: salaikrishnan as a volunteer commentedHi drclaw
I am need of this requirement and planning to contribute and fine tune patch. Do let me know if you have any further updates to the patch?
-Santa
Comment #21
TorreyToomajanian CreditAttribution: TorreyToomajanian as a volunteer commentedI understand that this is postponed until 8.x-1.x. Just wanted to voice my own interest/need for the D7 module to work with FacetAPI Pretty Paths. I have hacked up some additions to this module to meet a few personal needs for clients of mine, but the default paths still look awful compared to what the Pretty Paths ones should. If anyone is currently working on D7 integration between the 2 modules, let me know and maybe I can help. Otherwise I look forward to having this on D8!
Comment #22
monstrfolk CreditAttribution: monstrfolk commentedI am interested in this feature also and willing to write/review code.
Can you share a repo with me?
Comment #23
kyuubi CreditAttribution: kyuubi as a volunteer commentedHi,
Is this thread still alive? This is a pretty major requirement as a huge majority of sites out there have to rely on Pretty Paths.
Anyone still looking into this?
Comment #24
eugene.ilyin CreditAttribution: eugene.ilyin as a volunteer and commentedHello
Before, we need to develop 8.x version. I'm going to allocate time for it soon.
Comment #25
kyuubi CreditAttribution: kyuubi as a volunteer commentedHi eugene.ilyin,
Thanks for the quick reply!
I'm actually looking for this for the D7 version so if that's easiest that would be awesome!
Thanks in advance!
Comment #26
borisy CreditAttribution: borisy commentedEugene,
I am interested in this feature also for D7. Any chance that it might be implemented soon?
And thx for your module.
Comment #27
gresko8 CreditAttribution: gresko8 at jobiqo - job board technology commentedHere is my initial attempt for 7.x-3.x patch. It might need some improvement in a sense that we could maybe get rid of some code execution when using the pretty paths but it seems to be working fine for me.
The patch deals with checkboxes and links compatibility with pretty paths. I didn't have time to work on select/ranges widgets.
I tested multiple options per facet and navigation through browser history as well.
Comment #28
gresko8 CreditAttribution: gresko8 at jobiqo - job board technology commentedAttaching an updated patch which also includes search query in history.
Comment #29
gresko8 CreditAttribution: gresko8 at jobiqo - job board technology commentedOne more fix to unset the pretty_path query param so it doesn't clutter up views links.
Comment #30
gresko8 CreditAttribution: gresko8 at jobiqo - job board technology commentedI found out there were some warnings logged and setting breadcrumbs did not work correctly. Attaching a patch to fix that by making sure we are using the system path and not an alias in the background.