How to create a dynamic drop-down exposed filter?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by kirilius on January 10, 2011 at 7:47pm

I have a node type Gallery and I am building a view that displays each gallery as a grid of thumbnails. The view has one argument: Node ID. I need to add that as as an exposed filter so the users will see ALL galleries in a drop-down list and when they select a gallery, it will be displayed below.
The catch is that the list of my galleries is not static - I can add/remove/rename existing galleries. Basically I need the drop-down list to be populated from another view.
What is the best way to do this?

Comments

CCK node reference module

Posted by ben.hamelin on January 11, 2011 at 7:12pm

Look at the CCK node reference module. This will give you the ability to create a content type, add a field that is a reference to another content type, then configure your view to expose a filter of that field type.

SO, image content type, gallery content type. Image type has a node reference field against the gallery type. Expose the gallery filter and you'll have a view with drop down of all current galleries.

Hope this helps!
bh

Thanks, that is certainly one

Posted by kirilius on January 12, 2011 at 3:55am

Thanks, that is certainly one option but I don't wan't to over-complicate my site design. Currently I have a node type Gallery with a title and one field for all images. It is pretty simple to manage, I can use SWFUpload, referential integrity is there by default... If I go node-per-image, I would have to give up all that.

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /