Impossible to use a Page view or Block view with exposed filters without Ajax:
So exposed filters do not work without AJAX when using a view as the replacement for a taxonomy term page.
The problem with blocks relates to this:
#690748: Views exposed filters don't work in block display
The problem with pages is that the ACTION property of the exposed filter form will point back to the page view, so if a user submits the exposed filter form, they get sent to the page view.
Content Pane views:
ctools has a cool "Content Pane" view display type that allows a work around for this.
You can set a property in the views UI to let a content pane "Inherit path from panel display"
If [set to] yes, all links generated by Views, such as more links, summary links, and exposed input links will go to the panels display path, not the view, if the display has a path.
This property allows the Content Pane display to use an "override_url" property that gets set by panels when a content pane view is embedded into a pane.
I think this property would be a great way to fix links and filter POSTs on taxonomy displays that are embedding views.
Patch coming soon.
| Comment | File | Size | Author |
|---|---|---|---|
| #26 | taxonomy-display-views-url-1783968-26.patch | 631 bytes | fearlsgroove |
Comments
Comment #1
tmsimont commentedpatch attached
Comment #2
codycraven commentedExcellent, thanks tmsimont, I'll review when I get the chance.
Comment #3
lotyrin commentedI can reproduce the problem, but applying the patch doesn't seem to solve it.
Also the patch introduces trailing whitespace.
Comment #4
codycraven commentedlotyrin, did you attempt to change the View's display to content pane (and the taxonomy term's display to match)?
Comment #5
tmsimont commentedattached is a patch that addresses the whitespace issue (i think?)
also -- as codycraven points out, you'll need to adjust the view to use a display type of "content pane"
I know that requires ctools, it may also require panels...
Comment #6
lotyrin commentedOh, I see. Reading the issue and patch more carefully I see that it's strangely Panels-dependent.
This patch should work with or without Panels.
Comment #7
lotyrin commentedtmismont, could you see if my patch works in your use case (Panels and whatnot).
Comment #8
lotyrin commentedActually, since we're using $view->override_path, not override_url, we can make that even simpler.
view::get_url
view::get_path
I'm also now certain that this will have the same effect as tmsimont's patch, except that it doesn't check for Panels (and the result isn't dependent on Panels, so it should not check).
Comment #9
tmsimont commentedWell there are actually negative consequences of using override_url via those two functions.
I can't remember off the top of my head what those were, but this was the route I'd initially pursued before I ran into issues. I can re-test that approach and post back my problem within the next day or so, I'm currently caught up with a different project but will circle back to this by the end of the week.
Comment #10
codycraven commentedThe patch in #8 looks good to me, but I'd like tmsimont's opinion and testing if possible before committing.
Comment #11
codycraven commentedAs a note, this is the only issue preventing the 7.1 release.
Comment #12
tmsimont commentedok my bad i will get on this tomorro
Comment #13
tmsimont commentedhmm i'm not sure if it's related only to this patch or any other changes made in the 7.x-1.x branch but for some reason now when I view the manage display tab I get this error:
I also get a WSOD when I submit the taxonomy display form.
Comment #14
tmsimont commentedah I see the "ignore" plugin is now part of the core module -- i was using the same plugin namespace in a supplementary module (resulting in conflict with commit of #1798196: breadcrumb handling makes it impossible to alter breadcrumbs for terms without parents)
more testing...
Comment #15
tmsimont commentedah now i remember the problem with using non-panels here.
If you choose a block display, then your exposed filters disappear unless you have ajax enabled, due to the uses_exposed() function implementation in views_plugin_display_block.inc:
So even if you have the override property set, the lack of "use_ajax" in the block display hides your filters... I'll see how it works if you use a master display.
Comment #16
tmsimont commentedok #8 seems to work fine with the master display and panels display, it just doesn't really work with block displays -- but that's not really a big deal since my original patch doesn't fix that problem either. The issue with the disappearing exposed filters on block displays is an issue with views, not this module (i referenced this issue in my original post: #690748: Views exposed filters don't work in block display)
I think #8 works!
Comment #17
codycraven commentedCommitted and pushed to 7.x-1.x.
Comment #19
donquixote commentedThis seems wrong and causes problems with facet search.
The correct path would be
instead of
Comment #20
fearlsgroove commentedAlso bit by this issue when using facets. Whatever mechanism views is using to replace arguments in that URL seems to be views or panels specific.
Why not just use
current_path()?Comment #21
fearlsgroove commentedComment #22
hefox commentedPatch is being used on a project with multiple testers/developers and has not presented any problems yet and has fixed the issue.
Comment #23
codycraven commentedApplied and committed #21.
Comment #26
fearlsgroove commentedSo it turns out this does fix facets, but it breaks exposed forms. Views will attempt to add the arguments to the end of an override_path value, so when you search instead of /taxonomy/term/123?search=foo, you'll get /taxonomy/term/123/123?search=foo. This actually still works in some cases, but is clearly wrong and will definitely break in others (for instance if there are multiple contextual filters for which a default is provided).
If we use override_url instead, views just uses the url we provide and all works as expected.
Comment #27
vlad.dancer@fearlsgroove, thanks for the patch. +1 RTBC from me, but I've tested it only for views without facets.
Comment #28
Scott Robertson commentedI can confirm that this patch fixed the issues I was having with facets from the facet API using the wrong URL.
Comment #29
alexp999 commented#26 working well for me.
Comment #30
vbard commented#26 also worked for me, thank you guys!