Basically I want to have a simple search form on all my panel pages (by simple I mean no extra filters exposed in the form block except for the search terms form) that will redirect to a panel page showing their search results. On the search results panel page I want to have a different complex serchh form with more filters.

Steps I took to achieve this:
-Created a view of fields with a display content pane named 'Search results' and with the following settings:
--expose search terms (with the default filter identifier which is 'keys')
--expose form in a block
--use panel path
-Created a panel page for the search results and added the view for 'Search results' content pane
-Added the exposed form in a block view to my homepage (which is a panel page) with the 'inherit path' checked.
-Went to homepage typed in a keyword and got redirected to the homepage instead of the search results page - with the keyword I typed showing in url

I remember this use to work in previous versions... Any ideas why it's failing miserably for me for the last past 2 days?

p.s
When I'll finally make it work I'll add a recipe with all the steps, I think it's a great feature that many people can be interested in.

Files: 
CommentFileSizeAuthor
#6 ctools-views-content-custom-url-1417630-06.patch766 bytesjhedstrom
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

Comments

jjclint’s picture

Looks similar to this closed thread, but unless I'm missing something I'm not sure it works as designed anymore:
http://drupal.org/node/419556

merlinofchaos’s picture

The code for this is entirely in CTools, not Panels.

jjclint’s picture

Project:Panels» Chaos tool suite (ctools)
Version:7.x-3.0» 7.x-1.x-dev
Component:Views panes» Code

Thanks for the quick reply Merlin I'll move the issue

mansspams’s picture

zmove’s picture

Hi,

Any news about this problem ? It's a little dirty to proceed like this.

Alex

jhedstrom’s picture

Component:Code» Views Content
Status:Active» Needs review
StatusFileSize
new766 bytes
PASSED: [[SimpleTest]]: [MySQL] 121 pass(es).
[ View ]

This patch, not sure if it is the right approach or not, resolves this in my local testing.

To reproduce issue:

  1. Create a panel pane view with exposed keywords text filter
  2. Set exposed filters to be displayed in blocks
  3. link display, setting custom path to that of the panel pane
  4. place the views pane in a panel with the previously used path in step 3
  5. place the exposed filter block in a region and attempt to submit the form

without this patch, it always submits back to the current page.

Also, marked #1613410: Override Path on Views Exposed Form as a duplicate.

LeviThomason’s picture

@merlinofchaos can you confirm the approach in #6 is correct?

It would be nice to know if this is the way it will work in future versions so as to avoid any problems when updating ctools.

Thanks!

Edit: #6 works beautifully and is the functionality I had expected originally.

merlinofchaos’s picture

Yes, I think this is the correct approach. This patch will likely get committed when I have more time for it.

LeviThomason’s picture

Awesome! Thanks for the rapid reply. As stated the patch is working for me :)

axel.rutz’s picture

axel.rutz’s picture

I just see that the 2 issues we marked as duplicates actually seem NOT to be dups.

This issue fixes exposed forms *in block* submitting to the wrong url.

I can confirm the same problem for exposed form of a view in a panel NOT being fixed by this patch.

I'm not sure how this is interconnected so for now posting in this issue, later we might re-open a separate issue.

axel.rutz’s picture

OMG, we have a mixmax of several issues here:
* this issue description talks about "inheritpath" setting
* patch in #6 talks about and fixes the similar problem with "custom path" setting

of course for now we can workaround "inherit path" with "custom path" and #6 but that's a PITA.

axel.rutz’s picture

elly’s picture

Just a note that the patch in #6 worked perfectly for my use case - needed to put an exposed form block/pane in panels and have it redirect to a panels page with the view pane in it. Thank you!

maxplus’s picture

Issue summary:View changes

Hi,

thanks, #6 worked for me too.
I just had to search a little bit to find 3. but I finally found it in the advanced settings of the view in the bottom right corner.

I also disabled "inherit path" in my panel pane settings

bburg’s picture

Status:Needs review» Closed (works as designed)

Based on jjclint's use case in the original post, I believe this is "Works as designed." Using the inherit path option on an exposed form widget in a content pane, should make the form's action attribute use the path of the page that the form is displayed on (whether or not that is what OP was trying to accomplish). Perhaps the help text for this option should be a little more clear about what it does?

However, there is an entirely separate bug here that patch jhedstrom provides in #6 addresses (which I think is what jjclint was actually trying to achieve when opening this issue). The bug being that when creating a content pane display, with an exposed filter, which has a "customized" path, the custom url provided does not get used. For me, the url of the first occurring display (which was a page) got picked up instead. So presumably, without the patch in #6, the path us ultimately provided by views_plugin_display::get_link_display().

In that case, I've marked this issue as "Works as designed" and opened a new issue #2401635: Views Content Pane Exposed form in blocks don't use custom URL link displays to address that specific bug.

bburg’s picture

And FYI, I've created a separate issue to add description text to Inherit path option: #2401641: Description text for inherit_path in views_content_exposed_form_pane_edit()

TanvirAhmad’s picture

Seems like a an old issue but now settings is available in views itself.
If you are using Content Pane in views, you can set " Exposed form in block: YES" and "Use Panel path: Yes" in Pane Setting of the view.