Closed (fixed)
Project:
Facet API
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
18 Oct 2012 at 14:00 UTC
Updated:
2 Nov 2012 at 13:21 UTC
Given a set of values for different facets, is there any sort of API to create a link to that search result for placing elsewhere in the site?
For instance, suppose I wanted to render taxonomy term links with the link going to the search result on that facet.
Comments
Comment #1
cpliakas commentedThe FacetapiAdapter::getQueryString() and FacetapiAdapter::getQueryString() methods are probably what you are looking for. There could probably be an API function that wraps the code to output a link similar to the (untested) snippet below:
If you want to test it out, add docs, and implement some defensive coding, I would definitely be more than happy to commit an API function to Facet API.
Hope this helps,
Chris
Comment #2
cpliakas commentedOne thought, though, is that if you want to enter search keys then you will have to implement something specific to the backed to append the keys to the querystring or path. AFAIK Facet API doesn't have any abstraction on this level since the implementations are fairly different per backend, and under normal circumstances the module doesn't need to understand how the keys are passed.
Comment #3
joachim commentedThanks for the pointers!
I'm right up against a deadline right now so I hacked something, but I'll come back to this and make a patch.
Comment #4
cpliakas commentedNot a problem. Thanks for posting back. Marking as fixed, feel free to open a feature request if you do have some time for a patch.
Thanks,
Chris