Taxonomy Term Name Argument Per Vocabulary

linuxbox - July 8, 2008 - 15:16
Project:Views
Version:5.x-1.6
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

Hi. I've been wanting a feature to be able to add an argument to a view that is "Taxonomy: Term Name for %voc-name", for particular vocabularies.

For example, in one of our sites, people upload pictures. The pictures are about certain schools, and may be shown on the front-page of certain schools. Therefore, we have a vocabulary called "Subject School" and another called "Frontpage School".

Let's say someone takes a picture of a multi-school concert that happened at the "Intergalactic Space Academy" (which has the best auditorium in the galaxy).

Since members of the Neptunian choir were there, they want to show it on the frontpage of "Neptune Elementary".

So, the picture gets "Subject School": "Intergalactic Space Academy". "Fronpage School": "Neptune Elementary".

The default "Taxonomy: Term Name" will have it showing on the frontpage of both schools.

If I put an argument of "Taxonomy: Term Name for Front Page School", then this solves the problem.

Here's a patch to implement these types of arguments.

AttachmentSize
views_taxarg_from_voc.patch3.49 KB

#1

merlinofchaos - July 8, 2008 - 16:17

Why can't you just add the Taxonomy: Vocabulary filter?

#2

linuxbox - July 9, 2008 - 17:42

I might be wrong about this, but it looked like if I added the "Taxonomy: Vocabulary" filter and then the "Taxonomy: Term Name" arguments, then it would end up 1) Ensuring that the node has a term in the vocabulary, and then 2) Ensuring that the node has the term name in any vocabulary.

So, yes, if I have a node that has "Subject School"="Intergalactic Space Academy" and "Frontpage School"="Neptunian Elementary", then this node will satisfy those criteria. It has a term in frontpage school, and it has a term called "Intergalactic Space Academy".

Also, what if I want a view that shows me only the things that have subject school=neptune AND subject school=venus academy for the arts. Would I have two vocabulary filters, and the first one would be associated with the first arg, and the second one would be associated with the second arg? Again, I could be wrong, but it didn't look like that's how the Taxonomy: Vocabulary filter works.

With this patch, I can specify that it has two arguments: One for "term name from subject school" and one for "term name from frontpage school".

#3

merlinofchaos - July 9, 2008 - 18:12
Status:needs review» won't fix

Sorry, with Views 2 out, I'm not really going to add new features to Views 1.

#4

linuxbox - July 17, 2008 - 06:50

Could this feature go into views 2? (I haven't used views 2 yet).

#5

merlinofchaos - July 17, 2008 - 06:59

Yea, Views 2 has something like this. It's implemented as an argument validator though, which is much more powerful.

 
 

Drupal is a registered trademark of Dries Buytaert.