Active
Project:
Faceted Search
Version:
6.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 May 2008 at 12:31 UTC
Updated:
26 Jan 2012 at 01:45 UTC
Jump to comment: Most recent
Comments
Comment #1
Dr Jay commentedsubscribed
Comment #2
west_d_r commentedDefinitely interested in this as well. Subscribing.
Comment #3
Katinka commentedI'm interested in this as well. Anything done yet?
Comment #4
chaps2 commentedFrom what I can see panels isn't supported out of the box. With the results view embedded in a panel pane, the crucial faceted_search_ui url handlers are never called. For a quick and very dirty fix you could use the panels_pre_render hook to explicitly call those handlers. So in a custom module called custom have something like:
This method assumes that if your faceted_search environment base url is search then the panel URL would be search/results/%. To pass the correct environment id to the search panel I created a panel view of the results view, choosing to specify the argument value in the pane settings dialog.
As I said, that's the quick and dirty way to do it. I THINK the correct way to do it is to write a panels argument handler to handle the faceted_search argument and create a faceted_search context. I'm looking into trying this but if anybody knows that this is a bad idea or has any suggestions, please say.
Please bear in mind that I'm not an experienced Drupaler and that I have no involvement with this project other than experimenting with it and being very impressed with it! Hats off to David!
Comment #5
iaminawe commentedHavent had a chance to try this but will be doing so soon... thanks for the help
Gregg
Comment #6
elioshDear chaps2,
thanks for your trick but i have a problem. Even with your dirty trick, i'm unable to filter results in panel view.
I have "guided search" block in my sidebar, so i can see that using your suggested hook code, faceted search correctly "understand" what i'm searching, filtering taxonomy terms based on previous choose.
Faceted search id is 1, while URL for this search is "fs".
I create the view, and it works like a charm, showing node as a whole or as a teaser.
But if i try to use this view in my "page panels", it doesn't filter nodes, giving me all the list (i choose to show all), This "Page panel" respond on URL "fs/results", so overwriting original faceted search url.
Suddenly, i create a "views panes".
In fieldset "Argument: Faceted Search: Environment ID" i choose "From panel argument" for combobox "Argument source: " and for "Panel argument" i try the first four options, but with no luck.
Please, help me :-)
FYI : url for "working" view is "views_fs". Is correct if i say that this url is not important?
Comment #7
Drupal Berlin commentedI'd love to have this as well. Subscribing.
Comment #8
asak commentedWow. Subscribing.
Comment #9
summit commentedSubscribing, greetings, Martijn
Comment #10
Gábor Mayer commentedcould you write a step by step instruction manual how possible setting up faceted search + views + panels ? thank you.
Comment #11
jstirnaman commentedSubscribing. I'd really like to use Faceted Search with Panels, more specifically, to add the Guided Search refinements to a pane. I can't figure out how to pass a taxonomy term as a Faceted Search query into the Panel context.
Comment #12
mpaler commentedsubscribing
Comment #13
KingMoore commentedI have gotten this to work with the panels_sections module (http://drupal.org/project/panels_sections), although this implementation is way out of the box (and will probably make people cringe and berate me). Basically what I did was:
- create a panels page called 'search' and give it a path of 'panels-pages/search'. I give my panels pages URLs that I will not be actually using because I use panels_sections to define what paths get what panels pages.
- create my faceted search and set the path to be 'my_search'
- create a panels_section called 'search', register it to the path 'my_search/*', enable it, and assign it to use the 'search' panels page.
What this does is whenever a request is made for any page under my_search/, panels sections will load and use the panels page layout 'search'
- I now have my panel page loading on all the search pages, however there is no content showing. I now put the 'Panels Content Placeholder' block in my panels layout and save it (override title to blank). This makes it so the content that would show up on my search pages but is not displayed because my panel is shown, now shows up where this content placeholder block is (via some string replacement of %CONTENT% yeah I know not real clean blah blah blah)
- Lastly I can now add my faceted search blocks (guided search, current search, etc) to my panels page layout and don't have to worry about context, arguments, or anything. Bam, everything works.
So all in all this is a nasty solution but it is currently working for me.
Ka-Pow.
Comment #14
asak commentedNice one KingMoore!
I'll check this out...
Comment #15
vinoth.3v commentednote: panels_sections is only works with Panles 2 and deprecated for panels 3.
I am using http://drupal.org/project/panels_everywhere, works great.
Comment #16
adaddinsane+1, here's my experience:
The Panels Everywhere documentation implies that it takes over the whole site, it doesn't - unless you want it to. It also implies that it doesn't use the site theme, and that's not really true either (unless you don't want it to).
So, to force Faceted Search into panels (but not touch any other pages), I created one variant which uses the single column full width layout for the initial search page and then a second one that uses my "wide left column with right sidebar" layout for the results page. And place the main content in the wide left column and the blocks in the sidebar.
Let's say the URL is search/all and search/all/results, I use search/* and search/*/results* as the two selection rules, one for each variant. (Word to the wise: Panels takes the first matching variant so you need to put the results variant first otherwise the other one will match.) I used these selection rules because I have a search/all search, but then I might add a search/wibble or a search/gribble faceted search on the site, so these rules deal with all those instances in one place.
Another factor is whether you have Panels set to override the entire page template, or just the content area. This also influences Panels Everywhere as well. I have it set to just the content area, so Panels Everywhere does not take over the whole page, just the content area.
By not taking over the whole site and not taking over the whole page you can keep your site theme intact.
(The reason I mention about the documentation is that if you read it it might scare you off using Panels Everywhere because it "takes over the whole site" and "doesn't use the site theme". But it's the perfect way of integrating Faceted Search into Panels.)
Comment #17
Anonymous (not verified) commentedSubscribing.
Comment #18
1kenthomas commented// subscribing, bumping to D6
Comment #19
bendalton commentedOkay, I have had a lot of difficulty doing this myself, so I thought I'd share my findings.
I created a panels-page with the path my-search/!results/!search_terms .
Then I created a search environment with my-search as both paths.
I created a node view with a pager and selected it as the results view in my search environment.
In my panels-page, i added a custom panel with php content like so:
The first argument is the id of my search environment, and the second argument is the content of my search parameters (what comes after results in the url).
The tricks here are to create your panels-page first with the appropriate paths. This is because when you set your search environment paths, it does not verify that these are taken already. However, if you create your search environment first, panels will not let you use the paths registered by faceted-search when creating your search environment.
I am using views-2 because views-3 is not yet compatible with faceted-search views.
I am also embedding the guided-search block in my panels page the normal way, and it appears to work fine.
Lastly, I am using a default view in place of the search results when accessing the page without the 'results' in the url. The visibility of the search results and this default view are toggled via the the visibility rules in panels.
My next step will be to figure out how to use Panels to pass these values in as an argument so that I can reuse this approach in different pages without having to manually update the code.
I'd appreciate any feedback people have on this approach. I'd love to improve it.
Good luck.
Comment #20
mrP commented@bendalton -- nice work! much obliged.
Comment #21
tomlobato commentedbendalton, I tried exactly as you said in #19, but the search results keeps going to a NON-panel page (FS defaults).
After I tried some modifications, playing with paths, but can not get success.
Any ideia?
Comment #22
mstiThanks bendalton!
Your solution worked in a different way for me. This is the solution ofr anyone interested:
faceted search:
base path: filters
start page: filters/results
panels:
url: filters/results/!search_terms
Comment #23
tallsimon commentedI would love to know how to do this in a more fine-grained manner, for example to have a few views, showing lists of different types of content in different ways, and have each list filtered by the current faceted search terms. I expect this is not possible with the approach above?
Comment #24
1kenthomas commentedBumping; // are current solutions sufficient and/or shoud we remove from queue?
Comment #25
haopei commentedsubscribe.
Comment #26
xzabre commented» Wish I knew how to subscribe, so.. Bookmarking!
Comment #27
mparker17Subscribe
Comment #28
haopei commentedI'm reading all of this and it's pretty confusing. May I ask for someone to summarize the solution? I'm not particularly well at hacking modules.