Closed (fixed)
Project:
Hierarchical Select
Version:
5.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Jul 2008 at 16:31 UTC
Updated:
18 Jul 2009 at 10:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
jrbeemanComment #2
wim leersYes, that JS needs work.
It moves HS exposed filters to separate rows, because a HS needs a row of its own. If it doesn't have a row of its own, it'll start moving around the exposed filters "after" it (i.e. to the right of it). Which is *very* annoying.
The only solution is to make the JS better. No other solution is possible, because Views' exposed filters form has a hardcoded rendering to a table, so I can't just add a custom #theme callback for rendering that form.
It'd be great if you could improve that JS! :)
Comment #3
jrbeemanI wonder if the issues you were attempting to solve with the bulk of views.js were fixed by other stuff you've done in the meantime...? I just removed the code that alters the DOM, and things seems to still work correctly. The altered code works in both Garland and a custom, zen-based theme that has implemented theme_views_filters() to alter the filter HTML.
Comment #4
wim leersYour "Picture 2.png" file is still problematic. Try using HS to go to a next level and everything will jump around!
Comment #5
jrbeemanSo is the issue that the select boxes end up tiling down beneath each other? If so, it's not really that the HS widget breaks the HTML, it's that the default Views filters theme tiles the filters across table cells, simply not leaving enough room for the HS widget on each exposed filter. Am I understanding it correctly? The attached screens show a custom theme and Garland successfully rendering the widget with selections. In Garland, the select boxes are just all scrunched together.
The code below is what I used to alter the Views filters theme output in my custom theme. It renders the filters as a table still, but by making the header (label) for each exposed filter be in the left-hand column as opposed to the top row. This leaves much more room for the HS widget (and is a better default, in my opinion). It sounds like you can't override this in the HS module, though, right?
Comment #6
wim leersThat's right. But sometimes, when there's enough room, say you ONLY have a HS exposed filter and the submit button, things jump around to the HS.
I don't have to fix this, but it's nice to support it for my users. I'm very inclined to stop doing that right now though.
I think that's right, yes. I believe you can do this in Drupal 6 thanks to
hook_theme().I think the only conclusion can be that this CANNOT be solved automagically through some JS hackery. It generates as much problems as it resolves… So unless you oppose, I'm going to throw this out completely. I'll refer to this issue instead.
Comment #7
wim leersJeff, any feedback? :)
Comment #8
jrbeemanSorry for the delay - been buried in a project. When you say, "I'm going to throw this out completely" do you mean you're just going to take out that JS that alters the table? If so, I'm all for it. I'd be happy to provide a patch for the docs that show how to alter your views filters theme output to play more nicely with HS.
Comment #9
wim leersThe delay's not a problem ;) :)
I just committed your patch with some documentation improvements of my own thrown in. Setting to CNW because I'm welcoming your offered patch with wide open arms ;) :)
Thanks Jeff!
Comment #10
wim leersThere are several people waiting for that documentation, Jeff :) I don't mean to add extra pressure, but do know that your work won't be in vain!
Comment #11
jrbeemanI've attached a patch to the README with some instructions on overriding theme_views_filters().
Comment #12
jrbeemanComment #13
wim leersExcellent, thanks! Committed :)
Comment #14
wim leersOops, forgot status.
Comment #15
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #16
codenamerhubarb commentedThanks Wim Leers and jrbeeman... but I'm having trouble implementing jrbeeman's code. I already have the following code in my template.php file (this is pretty much the standard code from the Views Theme Wizard)...
...This code works very nicely in that I can chose exactly how I'd like the exposed filters to look by adjusting views-filters-ebooks.tpl.php
However, I still get the following errors on the page with my exposed filters and the HS form doesn't work properly:
Is there a way to implement jrbeeman's fix but still be able to customize the appearance of the exposed filters via a *.tpl.php?
Comment #17
wim leersjrbeeman, could you maybe answer this one? Thanks!
Comment #18
wim leersComment #19
wim leersI think the cause might be that you're not rendering the root level of the form. Try changing your code to:
Comment #20
codenamerhubarb commentedThanks Wim, I appreciate your effort in responding. I've made the change and I'll let you know if I experience the error again.
P.S. You were missing a couple of semi-colons on the last two lines.
Comment #21
wim leersLooks like this is fixed then. :)