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.
Comment | File | Size | Author |
---|---|---|---|
#23 | ctools-views-content-custom-url-1417630.patch | 770 bytes | joannasaerom |
#6 | ctools-views-content-custom-url-1417630-06.patch | 766 bytes | jhedstrom |
Comments
Comment #1
jjclint CreditAttribution: jjclint commentedLooks 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
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedThe code for this is entirely in CTools, not Panels.
Comment #3
jjclint CreditAttribution: jjclint commentedThanks for the quick reply Merlin I'll move the issue
Comment #4
mansspams CreditAttribution: mansspams commentedHere is a tip on how to do this #1741464: Use Panel Path doesn't affect exposed form block
Comment #5
zmove CreditAttribution: zmove commentedHi,
Any news about this problem ? It's a little dirty to proceed like this.
Alex
Comment #6
jhedstromThis patch, not sure if it is the right approach or not, resolves this in my local testing.
To reproduce issue:
without this patch, it always submits back to the current page.
Also, marked #1613410: Override Path on Views Exposed Form as a duplicate.
Comment #7
LeviThomason CreditAttribution: LeviThomason commented@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.
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedYes, I think this is the correct approach. This patch will likely get committed when I have more time for it.
Comment #9
LeviThomason CreditAttribution: LeviThomason commentedAwesome! Thanks for the rapid reply. As stated the patch is working for me :)
Comment #10
geek-merlinMarked #1741464: Use Panel Path doesn't affect exposed form block as dup
Comment #11
geek-merlinI 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.
Comment #12
geek-merlinOMG, 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.
Comment #13
geek-merlinCrosslinking #2009464: views_exposed_form_cache() flaw, eg. leads to exposed forms redirecting to frontpage which is the problem i really had.
Comment #14
elly CreditAttribution: elly commentedJust 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!
Comment #15
maxplus CreditAttribution: maxplus commentedHi,
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
Comment #17
bburgBased 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.
Comment #18
bburgAnd 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()
Comment #19
TanvirAhmad CreditAttribution: TanvirAhmad as a volunteer commentedSeems 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.
Comment #20
guilopes CreditAttribution: guilopes commentedthe #19 solved the problems to me
Comment #21
mellowtothemax CreditAttribution: mellowtothemax commentedApologies for reopening but it is not working for me. My exposed filter block (search fulltext) is visible on all pages (not just the panel) and although it works fine if I am on the panel page with url /search. If I search from any other page, I do not get redirected to the /search page and instead I am redirected the home page with the search result appended to the url eg ?search=...
Update:
I managed to fix this. I had not seen the option in views under Advanced > Other > Link Display. I set this to Custom Url with my panel page for search results and now it works.
I also used the patch in comment #2 from Views Content Pane Exposed form in blocks don't use custom URL link displays
Comment #22
jlongbottom CreditAttribution: jlongbottom at Myplanet commented#21 helped me a lot.
I was struggling to remember how to do this so it works from any page. Totally forgot about Link Display.
Thank you @mellowtothemax.
Comment #23
joannasaerom CreditAttribution: joannasaerom at Phase2 commentedI haven't posted on Drupal.org often so forgive me if this is not proper protocol, but here's the rerolled patch against 7.x-1.14 since patch from #6 no longer applies for the latest D7 code.