I want to make special Views filter allowing to select images only from specific gallery. The main idea is it should be used in exposed mode only, working in a "image browser" view types. It will show select element containing list of galleries of the current user, or all galleries list in a case of privileged user.
In summary, it will be similar to gallery selector on image edit form.
So is it good idea to make it as a patch to Node Gallery ? Will you accept it ?

CommentFileSizeAuthor
#2 node_gallery_selector-1242704-2.patch5.13 KBcrea
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

justintime’s picture

Sounds pretty cool -- I'd certainly commit it.

crea’s picture

Status: Active » Needs review
FileSize
5.13 KB

Patch attached.

crea’s picture

I've decided to drop support for privileged user browsing any user's albums. I think it wouldn't work because of number of albums. The select element would be too huge and unmanageble. I think different types of widgets are required for that task (Hierarchical Select, autocomplete, etc).

crea’s picture

I've noticed small bug: when ajax is enabled and the filter is set to remember selection, when I use pager on initial view load, the gallery selector resets to the first option in the list. The default filter selection is not present in the URL at the first page load, and when I change page using AJAX, remembered filter selection is not working for some reason
If I disable AJAX, the bug disappears. I tend to think this is a bug of Views.
I've created a Views issue for this #1248332: "Remember" feature of exposed filters doesn't work with AJAX and is generally fragile

UPDATE: I've reproduced this bug with simple node view, without Node Gallery involvement.

crea’s picture

Btw, this works wonderfully together with filter autosubmission from the Views Hacks project.

crea’s picture

Note that this a very basic filter. I thought about adding more features to it such as filtering out empty galleries, but decided to not do it. We can't support every usecase anyway and the best thing we can do is to provide basic implementation. Advanced selectors could be implemented using this handler as a parent class.

zengenuity’s picture

Status: Needs review » Closed (won't fix)

At this point, I won't be adding new features to the D6 version. If features are wanted for D7, please post a new issue.