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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

eugene.ilyin’s picture

Looks like a big refactoring, I will check it at weekends

eugene.ilyin’s picture

Status: Needs review » Needs work

Hello.

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?

eugene.ilyin’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
drclaw’s picture

Hi,

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

drclaw’s picture

Status: Needs work » Needs review
FileSize
21.82 KB

Okay, 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

eugene.ilyin’s picture

Thank you, I will review it at saturday

drclaw’s picture

Great. Thanks for the quick reply!

drclaw’s picture

Sorry, there was a slight error in the last patch. This one's better (I've attached an interdiff - it's a small fix)

eugene.ilyin’s picture

Status: Needs review » Needs work

Hm, I tried to apply this patch. How I should see effect?

drclaw’s picture

You'll need to install FacetAPI Pretty Paths and enable it for your index.

eugene.ilyin’s picture

And ajax facets should use "pretty paths" when I will use link from popup?

drclaw’s picture

I'm not sure I understand the question...

eugene.ilyin’s picture

How I can see "pretty paths" with ajax facets? Ajax facets can works without paths, only by ajax.

drclaw’s picture

Ah, 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

eugene.ilyin’s picture

Status: Needs work » Postponed

Well, 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.

eugene.ilyin’s picture

Category: Feature request » Plan
Issue summary: View changes
monstrfolk’s picture

Any plans to support this soon?

eugene.ilyin’s picture

@monstrfolk
Hi, unfortunately I'm pretty busy in last time. I don't think that it will be done in soon time

eugene.ilyin’s picture

Version: 7.x-2.x-dev » 8.x-1.x-dev

Postponed for 8.x-1.x version

salaikrishnan’s picture

Hi 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

TorreyToomajanian’s picture

I 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!

monstrfolk’s picture

I am interested in this feature also and willing to write/review code.

Can you share a repo with me?

kyuubi’s picture

Hi,
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?

eugene.ilyin’s picture

Hello

Before, we need to develop 8.x version. I'm going to allocate time for it soon.

kyuubi’s picture

Hi 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!

borisy’s picture

Eugene,

I am interested in this feature also for D7. Any chance that it might be implemented soon?

And thx for your module.

gresko8’s picture

Version: 8.x-1.x-dev » 7.x-3.x-dev
Category: Plan » Feature request
Status: Postponed » Needs review
FileSize
7.17 KB

Here 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.

gresko8’s picture

Attaching an updated patch which also includes search query in history.

gresko8’s picture

One more fix to unset the pretty_path query param so it doesn't clutter up views links.

gresko8’s picture

I 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.