I think it'd be useful to be able to setup views for terms in a given vocabulary.. so if there was an option "Add Argument" for "Taxonomy: Vocabulary ID" and "Taxonomy: Vocabulary Name" that would be sweet!

Comments

merlinofchaos’s picture

Status: Active » Fixed

This was more complex than I thought it would be; but it's now in there.

Anonymous’s picture

Status: Fixed » Closed (fixed)
mariagwyn’s picture

Status: Closed (fixed) » Active

It appears I have a habit of resurrecting long dead issues...

but where is this? I am looking for Vocabulary Name and can only find Vocabulary ID. Is it in 6.x?

Thanks,
Maria

mathis’s picture

Hi,

Up, It would be great to have vocabulary name as an argument (is it really more complex than term name?).

Thanks!

doughold’s picture

I agree, this would be a big plus in my eyes. I am using faceted search and you have to break up your taxonomies into different Vocabs for it to work right (at least as far as I have figured out). However, I also need a secondary navigation process that will allow a user to pass the vocab id/name as an argument via a link generated by Views. It is strange in my view that you can read the Vocab ID as an argument, but you cant use the Vocab ID in any generated links under the Fields, only the vocab name. Please correct me if I am wrong about this as I will be very happy if this is already implemented!

frames’s picture

Version: 6.x-2.x-dev » 6.x-2.3

This was supposed to be available one year ago! in Views 1.

Still not present for me in 6.x-2.3. Any chances to have it ported to Views2?

dawehner’s picture

do you need the vobabulary id OR name, or it is enough for you to get just the name.
This second should be quite easy to write

merlinofchaos’s picture

Patches work better than complaining.

gphoto’s picture

is it in there or is it not? I'd really like to be using it right now but it doesn't show up in the latest release.

leanazulyoro’s picture

Version: 6.x-2.3 » 6.x-2.6

I don't see the vocabulary name filter in 6.x-2.6 and I don't see a submitted path in this issue, is this available or not?

Brian294’s picture

subscribe. I also need vocabulary name for creating arguments. do not see it there. only have:

Taxonomy: Parent term
Taxonomy: Term
Taxonomy: Term ID
Taxonomy: Term ID (with depth)
Taxonomy: Term ID depth modifier
Taxonomy: Term synonym
Taxonomy: Vocabulary ID

Currently using Views 2.6

dawehner’s picture

Thats true. Its missing.
As alternative you could use Taxonomy: Vocabular ID and convert with validation php code.

eiland’s picture

subscribe. And do you have an example php snippet?

I'm trying to make a vocabulary page, listing all terms so category/global terrorism/iraq

Now I need to make path aliases and change the vocabulary id into the term :(

 $vid=$arg[0]
$result = db_query("SELECT name FROM {vocabulary} WHERE vid = '%s'", $vid);
$vname = db_fetch_object($result)->name;

$title = 'whatever... %1';
$handler->options['title'] = $title;

return TRUE; 

aargh

AnnanFay’s picture

subscribe. It's interesting to note that you can filter by vocabs but not vocab IDs!

dawehner’s picture

There could be two ways to do this

a) provide the argument: vocabulary: name. Its trvial to code
b) provide a argument validation plugin, which converts the name to an id, so its faster to query.

sicapitan’s picture

subscribe

devkinetic’s picture

subscribing

Can anyone tell me where this would be defined? If someone can give me a file / line of say Taxonomy:Term Name's structure I will work on a patch for this.

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new682 bytes

There is a think which does this. Its easy, as i said :)

kingandy’s picture

Patch works fine, though Views does complain that there's no 'help' defined on the argument...

dawehner’s picture

Could you write one?

kingandy’s picture

Sure.

diff --git modules/taxonomy.views.inc modules/taxonomy.views.inc
index 4b8d031..8ed9b9d 100644
--- modules/taxonomy.views.inc
+++ modules/taxonomy.views.inc
@@ -46,6 +46,9 @@ function taxonomy_views_data() {
   // vocabulary name
   $data['vocabulary']['name'] = array(
     'title' => t('Vocabulary name'), // The item it appears as on the UI,
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+      'help' => t('The taxonomy vocabulary name'),
+    ),
     'field' => array(
       'help' => t('Name of the vocabulary a term is a member of. This will be the vocabulary that whichever term the "Taxonomy: Term" field is; and can similarly cause duplicates.'),
       'handler' => 'views_handler_field',
dawehner’s picture

StatusFileSize
new751 bytes

I choosed another text, see the patch file

wjaspers’s picture

StatusFileSize
new9.44 KB

I dont have a CVS, any understanding of how to generate a patch in Windows, and the "Issue Queue Handbook" patch info wasn't very helpful; but, here's the code I created to use a Vocabulary Name as an argument, convert it to a vocabulary ID, and validate it against any number of vocabularies you may have.

This is basically ported code from taxonomy functions. I don't doubt there is room for improvement.
So far, I haven't been able to accept two (or more) arguments AND ignore the vocabulary arg if it isn't supplied--maybe someone knows what to fix....
Otherwise it has worked with minimal testing...

vood002’s picture

I successfully applied this patch to views 6.x-2.11 and all appears to be working fine. Would be nice if it was committed (assuming no bugs anyone else has discovered)

dawehner’s picture

#23 Please create a patch

#24 so #22 is ready to commited?

vood002’s picture

I've done limited testing on #22 passing a single vocabulary name as an argument and it's worked without any issue

brenda003’s picture

StatusFileSize
new20.59 KB

I created a patch for #23 before realizing #22 also provided a patch.

mrP’s picture

Version: 6.x-2.6 » 6.x-2.12
Status: Needs review » Active

Its great that views comes with an out of the box taxonomy_term view. Is it possible to extend this to taxonomy_vocabulary as well?

mrP’s picture

A few other thought in this vein: the default taxonomy_term view allows for multiple taxonomy arguments (ie /taxonomy/term/1,2). This displays all nodes associated with term 1 and term 2. So given an example taxonomy (below), in order to see all nodes associated with term 10, term 12, and vocab 4 I would have to set a path equivalent to /taxonomy/term/10,12,16,17,...,50. The alternative would be a vocabulary id argument (which I admittedly have NOT figured out).

To make vocabulary arguments and these situations easier to manage, is it possible to add a 'Taxonomy vocabulary' validator?

Example taxonomy:
Vocab 1
- term 10
- term 11
Vocab 2
- term 12
- term 13
Vocab 3
- term 14
- term 15
Vocab 4
- term 16
- term 17
...
- term 50

jelo’s picture

Could you please provide an example how taxonomy_vocabulary does get created?

I am still trying to figure out how to build a vocabulary browser in views without the need to use an external module, a similar discussion is at http://drupal.org/node/476116.

I already use the standard taxonomy_term view, but would like to add the option for users to go up one level to see all terms in one vocabulary and to go up another level to see all vocabularies.

iamjon’s picture

Status: Active » Needs review

changing status.
has anyone actually tested this?

iamjon’s picture

Status: Needs review » Reviewed & tested by the community

re-read the post
based on http://drupal.org/node/62066#comment-3343542 changing status again.

esmerel’s picture

Status: Reviewed & tested by the community » Fixed

Vocabulary ID and Name are definitely present in the 3.x line; this answers the original request. Any other issues or additions should be taken up in new issues/feature request, not by tacking more onto this one.

iamjon’s picture

Status: Fixed » Closed (fixed)

closing.

mrP’s picture

Version: 6.x-2.12 » 6.x-3.x-dev

beautiful. thanks for clarification.