Hello everybody,

I realized a photogallery using the guide "Create an image gallery using only CCK and Views" (http://drupal.org/node/144725).

To create the summary page, I use a taxonomy filter. In this filter I set the default setting to "sorted ascending". In this way, i display each taxonomy term in alphabetic way.

But, i would like to display them using a numeric-like order. I want display as first element the last taxonomy term created.

The view default sorting is "node creating date". If I set the taxonomy filter behaviour to "sort as view", I view each taxonomy term in the right way, but repeated as many times as the count of each node associated with that term.

Example:

First term: Baby's photo - term id = 7
There are 8 nodes associated with this term

Second term: Mountain photo - term id = 9
Thee are 5 nodes associated with this term

Third term: Car photo - termi id = 10
There are 2 nodes associated with this term.

My summary page should display:

Car photo
Mountain photo
Baby's photo.

If I choose sorted as view, i have ten time car photo, nine time mountain photo and eight time baby's photo!
I want to display it only one time.

using distinct does not work.

Thanks,
Fabio

Comments

kasiawaka’s picture

Hi Fabio,
I had the same problem and wasn't able to solve it using views so I did it using php and blocks:

The code was tested with Drupal 5.12.

<?php
$vid = 1; // replace 1 with your vocabulary id
$vocabulary = taxonomy_get_vocabulary($vid);
$tree = taxonomy_get_tree($vocabulary->vid);
print '<ul>';
foreach ($tree as $term) {
  print '<li>'. l($term->name, "taxonomy/term/$term->tid") .'</li>';
}
print '</ul>';
?>

This block displays list of terms from chosen vocabulary as a list. If you want to change formatting, replace ul and li with something else.

domesticat’s picture

Status: Active » Closed (fixed)

Closed while closing all Views support requests with no activity for 6 months. If you still need help, you may re-open this issue at any time.