Needs work
Project:
Image Browser
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
23 Aug 2009 at 02:38 UTC
Updated:
21 Aug 2011 at 12:05 UTC
Jump to comment: Most recent file
can you use filters with this version?
| Comment | File | Size | Author |
|---|---|---|---|
| #34 | cutoff-filter.png | 4.67 KB | rootwork |
| #31 | imagebrowser-exposed-filters-2792608-31.patch | 4.24 KB | idmacdonald |
| #30 | imagebrowser-exposed-filters-2792608-30.patch | 4.19 KB | idmacdonald |
| #29 | imagebrowser-exposed-filters-2792608-29.patch | 3.78 KB | idmacdonald |
| #22 | new_ui.png | 34.41 KB | peter törnstrand |
Comments
Comment #1
jseffel commentedYes you can. Expose the filters you want in the ib_browser view, then you'll need this patch: http://drupal.org/node/555612
Comment #2
jdelaune commentedWell v2 wasn't intended to have exposed views, although you can and jseffel has made a patch to make the work they will seriously mess up the styling.
The reason it's not intended is because there are very little useful filters you can expose on files in Views. Out of interest which filter do you plan to expose?
Comment #3
loze commentedFiltering by partial filename or imagetype would be useful, especially for sites with hundreds/thousands of images.
I will try the patch, and see what i can throw together.
thanks.
Comment #4
scroogie commentedFiltering by partial filename is especially interesting if you combine it with filefield and filefield_paths, which is one of the rare solutions to somehow ordering your files. A more sophisticated filter would allow to choose the taxonomy of the nodes the file is referenced in.
Drupal 6 really needs a way to tag or otherwise categorize images. I have pages with 20.000 and more images. :/
Attached is a better patch to allow exposed filters.
Comment #5
scroogie commentedWe need someone who is good at designing them, though. Starnox? ;)
I can write the hook_form_alter code if you want.
Comment #6
scroogie commentedWe could also filter by the user who uploaded the file.
Comment #7
jdelaune commentedSure if someone wants to write a patch I can do the UI parts.
Comment #8
scroogie commentedOkay, I'll do the patch. If you could review this patch here http://drupal.org/node/618838, I could also enable a views Relationship for nodes, which would give us some more opportunities on filters.
Comment #9
scroogie commentedOkay, here is a patch to be reviewed that lets us theme the exposed filters for the Imagebrowser view. I included the standard preprocess function and template, to make it easier. I hope the new file in the patch worked.
Comment #10
scroogie commentedErrrh, sorry, forgot the most important change. ;)
Comment #11
scroogie commentedThis one includes the patch from #4, so you only have to apply one patch.
Comment #12
scroogie commentedAny news on this? I'd be willing to contribute other patches.
Comment #13
peter törnstrand commentedThe patch seems solid. What is missing is the styling of the exposed filter, am I right? I will write the UI part of this feature if Starnox has no objections. Will return to this issue in a week. Marking as "needs work" as this will not be commited without the UI to go with it.
Comment #14
scroogie commentedGreat blixxa. Every contribution is welcome. If you need something in the code (theme function, template file, or whatever), ring me here. Also, I'd need to check the patch against the latest Views version. I was waiting for a basic review by Starnox.
Greetings
scroogie
Comment #15
jdelaune commentedI'm quite keen the make the filters optional. So if the view hasn't been modified to include filters then you won't notice that through the UI. The UI should adapt in size to accommodate both views with filters and without. Just my thoughts. Thanks for your work.
Comment #16
miro_dietikersubscribing
Comment #17
peter törnstrand commentedOk. So I have made a rough draft of how the UI could look like. I have tried to make it minimalistic. Please give som feedback on this.
Comment #18
peter törnstrand commentedHere is a patch for the filters UI (does not contain the modifications to the view).
Comment #19
jdelaune commentedMaybe something more like this. So the filter button toggles the bar on and off. While the filter bar is showing the paging bar at the bottom is hidden. Not sure how easy it will be to shift everything down but I'm sure it can be done.
Comment #20
scroogie commentedI think it would be good to have a "filters" button instead of only the handle (or perhaps both?). It will be more obvious for the ingenuous users. But why would you drop the pager? I can imagine that you often need both at the same time. The filter for roughly preselecting, and the pager to reach your goal.
Comment #21
jdelaune commentedWell you would toggle the filters on, narrow down your results. Then toggle the bar off and get your pager back.
Comment #22
peter törnstrand commentedI think that maybe we should make the filter panel a bit bigger so that a user can customize the exposed filters, maybe add more, and still not have the layout broken. See attached image.
Comment #23
jdelaune commentedWell lets go the whole way like in IBv1 where the filter window takes up all the browser window space. So if needed they can hit the filters button. Select their filters and then hit apply to go back to the browser.
Comment #24
buckley commentedsubscribing
Comment #25
peter törnstrand commentedStatus update. This is in the works and will probably be ready in the comming weeks. UI wise there will be a button next to Upload that when clicked displays the filters screen. Submitting the filters form takes you back to the filtered results.
Default available filters will be filename and file owner.
Comment #26
buckley commentedGood thinking to leverage view here devs!
Comment #27
peter törnstrand commentedSorry, I jumped on another feature request (custom title and alt attributes) instead of doing this one ... filters are on the way.
Comment #28
idmacdonald commentedHi,
Thanks to blixxxa for the patch in comment #18. That patch seems to style the exposed filters quite nicely, but when I hit the 'apply' button next to the filters I've set up, I end up with the site front page inside the image browser window.
It looks like some code needs to be added so that the exposed filter 'submit' button takes us back to that same screen. I've added the form_alter code suggested in #651360: Exposed views filters break on submit into my imagebrowser.module and have created a new patch, which I've attached. This seems to work for me.
-Ian
Comment #29
idmacdonald commentedSorry, here's the patch.
-Ian
Comment #30
idmacdonald commentedThe last patch worked for me, until I added an exposed autocomplete field. The JavaScript file for implementing autocomplete wasn't linked into the page. Here's a new patch that adds that in.
Also, I wanted to show the filters by default, instead of hiding them on initial page load. So, I made a one-line change to the CSS, removing the 'display: none' from the '.view-filters' class. But this is probably a matter of preference and different usage cases.
Thanks to Starnox for maintaining a great module.
-Ian
Comment #31
idmacdonald commentedDarn. There was a bug in the hook_form_alter code in the last two patches. I've fixed it and rolled a new patch.
-Ian
Comment #32
scroogie commentedidmacdonald: did you try the patch in #11? It had the logical modifications. blixxa said explicitly that #18 did not include the needed modifications.
Comment #33
gausarts commentedSubscribing. Thanks
Comment #34
rootworkThe patch in #31 mostly works great for me.
The only thing is the theming -- in my browser (Firefox Win 3.6) the bottom of the "Apply" button is cut off -- see attached screenshot. I also can't seem to adjust that pane -- clicking and dragging on the bar doesn't have any effect.
In terms of being able to apply filters, though, this works great.
Comment #35
nikolajb commentedAny chance of adding taxonomy term as a filter as well? I can't find it in views. Or am I missing something? I've got about a thousand images, using tags for galleries and content, so being able to filter by taxonomy terms in exposed filters would be extremely helpful :)