Has anyone got the two of these working before?

Basically I have search block and guided search keywords in right panel and I want to return the search results in the embedded view in the left panel.

I have followed the readme instructions and I can get the results to display in a view but when I use a panel override for the search/results/% it overrides the views results page but does not filter the results correctly. I have used the context "From panel argument" which I thought would filter the search results view correctly bu tit doesnt.

Does anyone have any suggestions about what I may be doing wrong?

Thanks
Gregg

Comments

Dr Jay’s picture

subscribed

west_d_r’s picture

Definitely interested in this as well. Subscribing.

Katinka’s picture

I'm interested in this as well. Anything done yet?

chaps2’s picture

From 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:

function custom_panels_pre_render($display) {
	if($display->owner->id == 'search_results_panel') {
		faceted_search_ui_stage_results(2, $display->args[0]);    // that 2 is the environment id
	}
}

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!

iaminawe’s picture

Havent had a chance to try this but will be doing so soon... thanks for the help

Gregg

eliosh’s picture

Dear 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?

Drupal Berlin’s picture

I'd love to have this as well. Subscribing.

asak’s picture

Wow. Subscribing.

summit’s picture

Subscribing, greetings, Martijn

Gábor Mayer’s picture

could you write a step by step instruction manual how possible setting up faceted search + views + panels ? thank you.

jstirnaman’s picture

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

mpaler’s picture

subscribing

KingMoore’s picture

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

asak’s picture

Nice one KingMoore!

I'll check this out...

vinoth.3v’s picture

note: panels_sections is only works with Panles 2 and deprecated for panels 3.

I am using http://drupal.org/project/panels_everywhere, works great.

adaddinsane’s picture

+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.)

Anonymous’s picture

Subscribing.

1kenthomas’s picture

Version: 5.x-1.0-beta3 » 6.x-1.x-dev

// subscribing, bumping to D6

bendalton’s picture

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

print(faceted_search_ui_stage_results(1, arg(2)));

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.

mrP’s picture

@bendalton -- nice work! much obliged.

tomlobato’s picture

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

msti’s picture

Thanks 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

tallsimon’s picture

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

1kenthomas’s picture

Bumping; // are current solutions sufficient and/or shoud we remove from queue?

haopei’s picture

subscribe.

xzabre’s picture

» Wish I knew how to subscribe, so.. Bookmarking!

mparker17’s picture

Subscribe

haopei’s picture

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