Hi,

I would like to create a list view of a similar taxonomy;

- bicycles
-- batavus
-- giant
- cars
-- audi
-- bmw
-- daimler
- motorcycles
-- honda
-- yamaha

This view should only list the terms of the first layer; bicycles, cars, motorcycles

In my view I've made the following settings;
View type -> list view
Fields -> Taxonomy: Term -> with link
Filters -> Taxonomy: Vocabulary Name -> is one of -> Catalog

This view will give me all the terms in the taxonomy and some of them are repeated more times.
I'm not sure how to set this one up, do I need arguments for this?

Any help is very appreciated!!
Cheers

Comments

cjester’s picture

Check out the "Views 'Group-By' Pack"
http://drupal.org/project/views_groupby_pack

It add "group by" options to the "View Type" list.

bartezz’s picture

Hey Chester,

Thanx, will look into it tomorrow!!

Cheers

________________
Live fast die young

bartezz’s picture

Hi,

Tried Cjester's recommended module but I don't think it does what i described above.

I found some code here: http://tela-web.com/drupal/another-taxonomy-term-list-for-drupal/

<?php
	$vid = 4;
	$terms = taxonomy_get_tree($vid);
	print "<ul>";
	foreach ( $terms as $term ) {
	if ($term->depth == 0) {
		print "<li>".l($term->name, 'taxonomy/term/'.$term->tid, array('title' => $term->name))."</li>";
	}
	} /* end foreach */
	print "</ul>";
?>

And it almost works the way I want. Yet this will create a link to taxonomy/term/10 which is transformed by pathauto to category/catalog/cars
But I would like to link to catalog/48/cars which pathauto will transform to catalog/cars

So I thought I'd do this

if ($term->depth == 0) {
	<del>print "<li>".l($term->name, 'taxonomy/term/'.$term->tid, array('title' => $term->name))."</li>";</del>
	print "<li>".l($term->name, 'catalog/'.$term->tid.'/'.$term->name, array('title' => $term->name))."</li>";
}

That does work partially. If the $term->name consists of specialchars like ( ) or spaces things go wrong.
If there a function through which I can run $term->name to have a url safe string by the settings I've made in the pathauto module??

So that "cars (all terrain vehicles)" will become "cars-all-terrain-vehicles".

Thanx a million!!
Cheers

________________
Live fast die young