Active
Project:
Facet API Pretty Paths
Version:
7.x-1.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Jun 2014 at 12:01 UTC
Updated:
2 Dec 2014 at 19:25 UTC
Jump to comment: Most recent
Comments
Comment #1
dasjogetting base path right is a tricky thing as it depends on your exact setup, see #1861786: Fix base path issues
Comment #2
vlad.dancerHi, kamranzafar and dasjo.
First of all thanks to dasjo for awesome module.
Yesterday I've bumped into this issue to. And I've found only one method to resolve this task.
First of all we need some kind of patch on method public function getBasePath()
from facetapi_pretty_paths/plugins/facetapi/url_processor_pretty_paths.inc to allow pretty_path get right alias for the base path.
Something like:
Next if we do this we should get "page not found", when follow updated facetapi link.
It's because there is no such menu route as taxonomy-tem-alias/facet-name/facet-value/facet1-name/facet1-value.
In this case we need tell drupal what is the right system path. I did it using hook_url_inbound_alter().
Something like this can help:
I hope this will help you.
BTW: @dasjo is it right place getBasePath method to place special handling for taxonomy type base path getting?
PS: Not sure that this is correct way, but anyway.
Comment #3
dasjohi,
i'm glad you like the module!
1) setting up a search for the path that accepts arbitrary parameters (/%/%) unfortunately doesn't work out of the box as far as i know. at least i didn't have luck with views & panels to do so.
2) we can override taxonomy/term/% with a search api view and then put facets on it to emulate that behavior. did you do so or did you use another method?
3) in this case, as stated in the original report, the term alias isn't used as base path but the internal url:
4) your solution in #2 is a valid approach but requires patching. an alternative solution has been documented in #1468922: URL aliases require workaround but isn't perfect either. if desired, we can add a hook to the
FacetapiUrlProcessorPrettyPaths::getBasePath()method.i would really like to see if there is a solution for 1) but i don't know much about the routing system...
Comment #4
vlad.dancerThanks for sharing another approach.
But I think it is not good when we have tons of links on the page. That method invokes hook on each url() func.
As I know there is no solution for 1) method (at least in Drupal 7).
Also I think getBasePath() is a good place to add taxonomy based base path handling, same as for search_api_facetapi module done. Or create some alter hook in the FacetapiUrlProcessorPrettyPaths::getBasePath() if it's more convenient for you.
Comment #5
vlad.dancerOh, btw, I've used page manager to override taxonomy page.
Comment #6
dasjoif concerned about making getBasePath too heavy, we can alter the default base path generated at the end of fetchParams
Comment #7
vlad.dancerSounds good.