Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 ?
Comment | File | Size | Author |
---|---|---|---|
#2 | node_gallery_selector-1242704-2.patch | 5.13 KB | crea |
Comments
Comment #1
justintime CreditAttribution: justintime commentedSounds pretty cool -- I'd certainly commit it.
Comment #2
crea CreditAttribution: crea commentedPatch attached.
Comment #3
crea CreditAttribution: crea commentedI'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).
Comment #4
crea CreditAttribution: crea commentedI'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.
Comment #5
crea CreditAttribution: crea commentedBtw, this works wonderfully together with filter autosubmission from the Views Hacks project.
Comment #6
crea CreditAttribution: crea commentedNote 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.
Comment #7
zengenuity CreditAttribution: zengenuity commentedAt this point, I won't be adding new features to the D6 version. If features are wanted for D7, please post a new issue.