Hi,
I am trying to put inside a panel a view which have exposed filters.
Is it possible to stay inside the panel when the exposed filters are used ?

If yes, How can we do that ?

If no, is it something that is planned to be added ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

julma’s picture

I have something working :

I set the panel url to "panel1/%"
and the views url to "panel1/views1"

Then I have put the view in the panel and now I can use an exposed filter of the view, for example "node type" and use this filter inside the panel.

I am not sure though to understand how everything is working so if somebody have more details about how a view is supposed to work inside a panel, I am still intersted.

zmove’s picture

Another solution tested & approved by me is to theme the redirection of the form in your template.php

function theme_views_display_filters_VIEWNAME($view) {

  $form = drupal_retrieve_form('views_filters',$view);
  $form['#action'] = 'THE URL OF YOUR PANEL'
  drupal_process_form('views_filters', $form);
  return drupal_render_form('views_filters', $form);
}
sun’s picture

Status: Active » Fixed
SocialNicheGuru’s picture

subscribing...

if this is the only way to get exposed filters to work, then so be it!

btw- this is NOT fixed

skizzo’s picture

I am addressing panels with URL's like review/18/96 where
first argument is used by panel, second argument is handed over to view

panel name: review
panel URL: review/%
view name: review
view URL: v/review/$arg

what exactly should I add to template.php? Not being a programmer, so far I only
managed to get a white page. Maybe I am missing something trivial, or maybe it
can't work in my use case? Thank you.

SocialNicheGuru’s picture

Priority: Normal » Critical
Status: Fixed » Active

This has not been fixed for D5.

1. create any view with exposed filters; http://mysite.com/myview is the url
2. create node/%/somepage
3. create context
4. add myview to a pane in the panel (you can use legacy views or import view)
5. set arguments

Option 1:
set url to panel
I am taken out of the panel and to the original view page
more link and link to view go back to http://mysite.com/myview

Option 2:
set url override manually:
node/$arg/somepage (which is the url of panel)

While the more link and the title link goto the http://mysite.com/node/$arg/somepage (where $arg is replaced), the exposed filters go back to the original view again.

SocialNicheGuru’s picture

Status: Active » Fixed

I am closing this. My problem was with Views Exposed Filter block specifically. It is not working with panels. I will repost there. Thank you for your patience and understanding.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

SocialNicheGuru’s picture

Version: 5.x-2.0-beta2 » 6.x-2.x-dev
Status: Closed (fixed) » Active

When exposed filter block is added to a panel page, the submit button takes me to the url of the view not the panel even if the panel override is set.

dawehner’s picture

did you created a view with a display page, can you try to add a view pane as display type.
This should solve the problem.

if not you could try to set
$view->url

SocialNicheGuru’s picture

Dereine, how would I set $view->url?

glass.dimly’s picture

Another option is to use the Insert View module and embed a view in a node, then add that node to a panel. This worked for me.

ctalley5’s picture

Similar issue... only not sure the Insert View module will work.

I have a view that has 2 View Panes... (1 table & 1 Gmap)... and exposed filters - no arguments. I have the 2 View Panes placed on the same Panel as well. The URL i have for the panel is.... www.example.com/browser.

Since I have 2 view panes that should be linked by the exposed filters, I don't think it will work embedding the view into a node.

esmerel’s picture

Status: Active » Postponed (maintainer needs more info)

If this is happening under 6.x-2.x, you need to try it with panels 3 - Panels 2 will not have any further updates for Drupal 6. I'm not going to close it yet because it's been reopened a couple of times, but I'm not going to let it sit active if it's not for a current version of Panels.

SocialNicheGuru’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Status: Postponed (maintainer needs more info) » Active

It was happening under panels 2.

Currently this is still the case in panels 3.

Exposed filter block placed on a panels page does not work as per #6.

Thanks,
Chris

joeslow’s picture

In Panels 3, in Panel Pages, in the view settings select to Override the URL and point that to the panel page name.

Works fine without requiring tricks on the view or panel page URLs

R.Hendel’s picture

Is this issue still active?
joeslows hint works fine for me, too.
Regards, Ralf

merlinofchaos’s picture

Status: Active » Fixed

Sounds like we're all good, then.

IMO there needs to be a mechanism to make this more seamless but for now this works well enough.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

slashwalk’s picture

Hi Joe, how exactly did you get this to work? I went to the view pane in my panel page, click on the pane settings and im not sure what you mean with "panel page name", dont i have to input the panel url in Override URL? Do i have to set anything on the View? or just on the panel page? Thanks in advance

paul.brightlemon’s picture

Here's how I got it working using joeslow's method - Go to your panel page's edit screen and click on 'content'. Go to the 'settings' screen for your view content. In the 'override URL' field, enter the URL from your view page (NOT the panel's URL). Hope this helps!

srsbl’s picture

It also works if you create a content pane display and set "Use panel path" to Yes, under the Pane settings. Then you just need to select that view pane in the panel.

crutch’s picture

subscribe

pelicani’s picture

Awesome tip.
I wondered when that would be useful.
Now we know.
thx joeslow

R.Hendel’s picture

Hello,
for me setting "Use panel path" does not work.
I am at march in calendar. By clicking in next (month) url changes to /calendar?=calendar%2F2010-04 but calendar displays month view of march...
Clicking back gets same result.

merlinofchaos’s picture

calendar has its own issues with Panels because of its rather complicated arguments.

bowwowadmin’s picture

I am trying to have an exposed filter in pane 1 and results in pane 2 I tried to follow #16 but to no avail. what should my views settings be and such?

capellic’s picture

I was able to get this to work. My case is extremely similar the one in #13. I tried what Paul instructed in #21, but that wasn't right.

My Case: Allowing one exposed filter to control two views in a panel.

I have a business directory page with two views, a list taxonomy menu displayed as a block and the need to have "search terms" exposed filter. I have a screen shot attached to clarify my case.

Both views have to be setup as displays of type "page" as these are the only types of panels that can have exposed filters (as far as I know).

Add the "Search: Search Terms" filter to both displays and make both of them exposed filters. Both displays should have the same Filter Identifier for the search terms filter. If you've left the default as "keys", you're fine. In the Basic Settings section of the display configuration, set "Exposed form in block" to "Yes" -- but we're only going to use one of them. We do this so that both views are listening for a filter.

In my case, I wanted the exposed filter in the right sidebar, and not the view. I added one of the two exposed filters to the right sidebar on the Blocks list page.

Add both views to a panel. In pane settings for the view that is being used for it's exposed filter, set the Override URL to the panel URL. You may want to set the Override URL for both of the view panes just to be safe.

Since I also have a taxonomy menu displayed, I chose to check "Send arguments", but it isn't necessary just to get the exposed filter to work with both view panels.

What's really cool in my case is that if I search after having already selected a taxonomy term, I will search *within* that term.

wolfraem’s picture

This is really cool, thanks for sharing that. Perfect timing, too -- needed the "duh" moment reminder on the "exposing the filters as a block" option in the view settings.

greg.harvey’s picture

Category: support » bug
Priority: Critical » Normal
Status: Closed (fixed) » Active

I think is still active. It certainly behaves very strangely. I finally got something to work, largely following #28, but if your two pieces of content are in the same region (filter and output) then it seems the order matters. And, counter-intuitively, your results pane needs to be first!

To repeat what I'm seeing, create a new view with a page output and exposed filter search terms. Then create a panel page and place both the exposed filter (page, not defaults) and output (again, page, not defaults) in to the same region, but make sure the exposed filter form sits *above* the output. For the output pane, Override URL needs to be the panel page URL, as described above. Save and search, and you'll find that even though you have set an Override URL, it is ignored and the View URL is used instead. Or that's what I'm seeing anyway.

Switch them around (output pane first and filter form second) and it works! =/

Ps, I worked around this by creating a new region above the current region and putting the form in one and the results in the other - then #28 worked for me, so the bug is specifically if the form and results reside in the same region.

EvanDonovan’s picture

See #808178: Make the exposed filter blocks available to panels, even though the only other views blocks are the "content panes" for the way that getting just the exposed filter to show in a view would have to be fixed.

meba’s picture

I can confirm this is still a problem in Panels 3.

I have a View with Content pane display, I have "Use Panel path: Yes" and in Panels settings, I have url overriden to X. The view doesn't have any Page display.

I have AJAX on.

First reload works. Second generates a filter form with "/" action instead of the panel path.

merlinofchaos’s picture

Yes, it is a known issue that when using AJAX, pane override settings get lost. There is no way to fix that.

MickC’s picture

How do I get a panel argument to get passed through to a view filter?

I have a page with a panel containing a view, which receives an argument from the page, but also has some exposed filters.
This is all working perfectly, however if I click Apply on the exposed filter, I go through to the page display of the view which also uses exposed filters - but the argument is being sent in the url path (/arg), and it needs to get passed to the exposed filter (?field=value).

I can't seem to modify the view url override/panel url override/argument options to get this to work.

Any ideas?

3dloco’s picture

@MickC

I also was having trouble with arguments and filters, but in my case I was using content panes display for a view that also had a page display. However, I did not want the user to be directed to the page display after using the filters.

I made it work using content panes since I have additional settings regarding the pane settings (including where to get the arguments for the pane).

For the Content Pane Settings:
-Admin title: Use view name
-Admin desc: Use view descrip...
-Category: View panes
-Link to view: No
-Use Panel path: Yes
-Argument input: Edit
--- Argument Source: From Context
---Required Input: Raw String
-Allow settings: Some
---Path override

For the Arguments:

I first created a placeholder for my argument using %name and set the panel path to page/%name
Then, I set up the context for the arguments as a STRING and set the context identifier to %name (same name as the placeholder for my argument).
After setting this up, I added the content pane and set the "Override Url" to /page/%name:raw

For the Filters:

I moved the exposed filter to a block as explained in #28 by capellic.
-I first changed the content pane setting "Exposed form in block" to YES.
-Then, added this block to my panel (by the way this block is under the Views link/tab).

Hope this helps,

KH

merlinofchaos’s picture

#34: At this time there is no way to get arguments to go to filters.

hawleyal’s picture

#35 is not working for me.

"View > Content pane > Use Panel path: Yes"
This allows the filters to work within the view on a panel.
It doesn't enable an exposed form block to have the correct path.

"View > Content pane > Allow settings: Path Override" and corresponding "Panel > Pane > Override URL"
Must accomplish something similar to use panel path, but with custom paths.
It doesn't enable an exposed form block to have the correct path.

A possible solution exists in a related issue.

Shouldn't this be a fixed in panels directly though?

Why would you ever want to override the path for the content pane, but not it's corresponding exposed form block?

hawleyal’s picture

#30 speaks the truth about the order.

But even if you put the form in a different region, it must be after the results.

This is pretty useless. Who wants the filter form below?

It does work if you do 2 column and put the filter form on the right. Meh.

MrMaksimize’s picture

Oy. Ok not sure how I got this to work, but here's the deal.

I created a view with default, block and content pane displays. For Default and Content pane, I did not use the exposed filter. but for block i did.

Then in the pane, I added the view's block as a widget, and the view itself as a block.

For some reason, that works flawlessly. I also have ajax enabled in the view.

Lol BUT can anyone tell me WHY that worked. I got it working on a fluke

merlinofchaos’s picture

Status: Active » Needs review
FileSize
4.88 KB

Here's a patch. This patch improves the exposed from in a block content type to include a checkbox to allow you to inherit the path. For new blocks this should default to yes since that's the more likely desired setting. For existing blocks this will default to unchecked since that is the current behavior.

I cannot reproduce nor explain why the order is important. For me, the order seems to have no relevance whatsoever. I will say that the 'block' view display does not accept exposed filters unless AJAX is on, so this may be part of the problem. You should probably use content pane displays instead, anyway. For my tests I did this with one content pane and one block display and both managed to use the exposed filters, so long as they have the same identifier.

sun’s picture

+++ includes/content.inc	11 Aug 2010 21:47:09 -0000
@@ -264,7 +264,14 @@ function ctools_content_render($type, $s
+  $function = ctools_plugin_get_function($subtype_info, 'render callback');
+  if (!$function) {
+    $function = ctools_plugin_get_function($plugin, 'render callback');

If this pattern happens more often, then it might make sense to adopt something along the lines of D7's new hook ($type) argument of http://api.drupal.org/api/function/drupal_alter/7 -- i.e., when passing array($subtype_info, $plugin), return whatever is available first.

+++ views_content/views_content.module	11 Aug 2010 21:47:10 -0000
@@ -51,16 +51,64 @@ function views_ctools_block_info($module
+  // This is a cheesy way to add defaults only to new versions of the block
+  // but leave older blocks without the setting alone.
+  if (!isset($form_state['conf']['inherit_path']) && !isset($form_state['conf']['override_title'])) {
+    $form_state['conf']['inherit_path'] = TRUE;

Can we try to clarify the relationship to 'override_title' a bit more? I've to guess that it might have been introduced at the same time? (I don't think so? but perhaps mistaken)

+++ views_content/views_content.module	11 Aug 2010 21:47:10 -0000
@@ -51,16 +51,64 @@ function views_ctools_block_info($module
+  list($type, $name, $display_id) = explode('-', str_replace('views--', '', $subtype));
+  // Put the - back on.
+  $type = '-' . $type;

This kung-fu could use some code comments explaining underlying expectations and intentions.

Powered by Dreditor.

merlinofchaos’s picture

If this pattern happens more often, then it might make sense to adopt something along the lines of D7's new hook ($type) argument of http://api.drupal.org/api/function/drupal_alter/7 -- i.e., when passing array($subtype_info, $plugin), return whatever is available first.

Great idea, though it'd be difficult to modify the existing function to do it since the $plugin is already an array. But maybe a secondary function could do the job and loop through an array or do something nifty with func_get_args(). That's an interesting idea for later, though, it wouldn't be part of this patch.

+ // This is a cheesy way to add defaults only to new versions of the block
+ // but leave older blocks without the setting alone.
+ if (!isset($form_state['conf']['inherit_path']) && !isset($form_state['conf']['override_title'])) {
+ $form_state['conf']['inherit_path'] = TRUE;

Not sure it needs to be stated; override_title is available on every item with settings, unless specifically included; so testing for it tells us whether or not settings have previously been made. At least in theory. I don't think I tested to confirm.

merlinofchaos’s picture

Michelle had problems when the delta had been turned into a hash due to length issues. This patch should fix that, plus addresses sun's comments as well as I can.

merlinofchaos’s picture

Status: Needs review » Fixed

Ok, feedback is that this is working, so I've committed it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

AdrianB’s picture

Just wanted to thank srsbl in #22 for guiding me in the right direction.

jayhariani’s picture

Excellent tip. #22 worked for me with a relatively simple table and exposed filter.

nJim’s picture

#35 You are a life saver.

a.milkovsky’s picture

#35 you are right.
The main setting was in views for "Content Pane Settings": Use Panel path: Yes.

thanks

nigelwhite’s picture

Issue summary: View changes

#49 Thanks for your summary. That's all I needed to do.

Drupal 7.60. Panels 3.9