Normally I would just write a custom module to accomplish what I need to do, but I'm trying to teach my wife how to use Drupal for her site and she is not a coder. We've been working through Views2 and as such have hit a roadblock on one thing. I'm hoping we can all show her what a great community we have here :)

The goal is to have a paginated gallery page, with distinct values (no duplicate photos) and grouped by people (taxonomy term).

We have a content type for image gallery. This content type has the following fields:

- title
- image
- people (taxonomy term)

The view has the following configuration:

- Display: Page
- Distinct: yes
- Style: Unformatted - Grouping field - taxonomy term
- Fields: Node: Title, Taxonomy: Term, Content: Gallery
- Filters: Node: Published or admin, Node: Type = Gallery Image, Taxonomy: Vocabulary = People

We've customized the template: views-view-unformatted--gallery-page.tpl.php . I've done away with the foreach loop for the $row variable to only display: $row[0]

----------

The problem we are running into is that we're getting all photos uploaded from that specific taxonomy term (People). We only want 1 photo, per term within "people" category. The above template fix that I had implemented won't cut it, because the paginated results are still counting all the other photos.

Any input would be greatly appreciated. I would like to avoid writing a custom module for her, cause I'd really like her to learn how to do this!

Thanks in advance.

Link to what we currently have: link: http://shhimtryingtoread.com/gallery

Comments

nevets’s picture

If "Gallery" is an image field in view it will have setting "Group multiple values", make sure that is checked.

When checked it shows some additional settings, set "Show value(s)" to 1 and "starting from" to 0

blueflowers’s picture

Thanks for the quick reply. We don't see any options to specifically group by photo except under the "settings" for "style options" and we're already grouping by the taxonomy term. The content type uses the file type with image widget.

nevets’s picture

Which version of views are you using?

blueflowers’s picture

My bad. I forgot to post that.

Views version: 6x-2.12

nevets’s picture

Not setting under style options, the setting for the image field. Under "Fields" click the image field name to edit the options for that field. The grouping option was present in 6.2.10

An alternative approach is to add a filter on the image fields delta with the operator set to "Is equal to" and the value to "0"

blueflowers’s picture

We're going to try the alternative approach you mentioned, I'll post the results :)

--UPDATE---

We tried the alternative approach you mentioned, but it yielded 0 results, tried playing with it a bit, to no avail.

"Under "Fields" click the image field name to edit the options for that field. The grouping option was present in 6.2.10"

-- We still don't see the grouping option you mentioned.

blueflowers’s picture

Tried both approaches. The results were not good.

- The first approach you suggested had no effect at all. All caches cleared ;)
- The second approach actually displayed no results at all.

I played around with both of your approaches, to no avail.

A link to the dev site, using print_r to display the results of your first suggestion. http://dev.shhimtryingtoread.com/gallery