Assign taxonomy term to Views display?

Starnox - June 30, 2009 - 13:57

Is there a way I can assign a taxonomy term to a Views display (page). Or maybe set a taxonomy depending on the path?

I.e. all nodes with the path /fruits/oranges/* gets assigned the taxonomy oranges?

What are you trying to

nevets - June 30, 2009 - 14:08

What are you trying to achieve? Taxonomy terms are assigned/associated with nodes.

I know, but when you create a

Starnox - June 30, 2009 - 14:59

I know, but when you create a view which is a page display then it effectively is like a dynamic node.

Basically bits of the site gets loaded in depending on the terms, which is great in most cases when it's just nodes, but there are few places where I need it to happen on views as well.

In the past I've just used embedded views but I now need to do a view which takes in arguments from the url, but if you put arguments on the end of a node url it tries to find an alias for that rather than treating them as arguments.

Ok, what are we talking about

nevets - June 30, 2009 - 15:23

Ok, what are we talking about here, a view or node? They are different things.

If about views, you can make a view that takes arguments and add a page display.

Well, here's an example of

redspire - July 15, 2009 - 01:05

Well, here's an example of the problem from another perspective.

Say I create a a taxonomy vocab like 'section' or 'department' to load some extra data or change the appearance of nodes. I use pathauto to create a URL for the node based on the section, a view to output the section name in a block, and jQuery to change the appearance of the block based on the section name printed in the block. But this method doesn't work if the URL points to content served by a view [page] -- IE, my view that pulls the section name obviously can't pull a taxonomy tag if the source is a view.

So in my case, using taxonomy for section won't work on a view because taxonomy only applies to nodes. In my case I'll need to do something else for views, like go into the template layer and use some PHP to filter on the URL, which contains the section name.

I don't know how to do it, but maybe if you need to do some minor categorization of views like I've described, you could use the administrative tags for a view. I haven't looked but probably the views API offers access to those tags.

So I believe the message here is you'll need to find another way to categorize and filter against views.

 
 

Drupal is a registered trademark of Dries Buytaert.