Is there a way to pass taxonomy id's as arguments? I've seen that you can include %nid, %author, %viewer but %tid doesn't do anything.

Is there some other variable (%xxx) that will pass the assigned taxonomy?

If not this would be an ideal feature.

Comments

chrisroditis’s picture

I second that! This is a very useful feature. Perhaps it's already there but we are missing it?

mfredrickson’s picture

ATM, this is not possible. I'll keep it in mind as I expand the token replacement in viewfield. I could probably steal some features from custom_pager, as I know it does this.

mfredrickson’s picture

Status: Active » Closed (duplicate)

I'm lumping all the "extend viewfield to support XXX in the args..." with

http://drupal.org/node/121496

That issue is about including token.module support. Token does a great job of handling all these requests in once place. It should be in viewfield fairly soon. I'm waiting on token for a bug fix.

eikes’s picture

Title: pass taxonomy id's as arguments » pass multiple taxonomy id's as arguments
Status: Closed (duplicate) » Active

it took me some time to figure out, because it doesn't say so explicitly anywhere. But here is what you need to do.

  1. Install the token module
  2. go to the configuration of the viewfield and where you would have entered %nid and stuff you can now enter [term-id] (and much more)

that's it!

Quite nice, but the problem I'm having is that it passes the top most term id only. I would like to limit the term(s) passed to terms from a certain vocabulary and be able to pass multiple terms to the view. Am I missing something or is it not possible at the moment?

mikeschinkel’s picture

I have almost exactly the same need as Eikaa in that I want to pass in all of the terms for a vocabulary to my view. I am currently using the following code in my node template (node-product_category.tpl.php) but would prefer to give my administrator control of this in the admin console:

print theme('view', 'product_category', 25, true, 'embed', array_keys($node->taxonomy));

(Note in my current use case I don't need to filter on multiple vocabularies because I am currently only using one, but I can see where I might need to add another vocabulary to the product_category content type.)

Then in my view I added three arguments each being another "Taxonomy: Term ID" with Default="Display All Values." To illustrated how the view works, consider the following URL that would list the intersection of products that have all of the three taxonomy terms 1, 2, & 3:

http://example.com/product-category/1/2/3

Failing getting this accomplished instead with viewfield and tokens, is there a simple hook in a custom module I can write that will let me tell the view what taxonomy terms to use so that I can enable display of the view if they switch themes? I can write the custom module but views and tokens is complicated already so I'd need guidance otherwise I'd probably be looking at a week's time exploring the inner workings to learn it well enough to do this, and unfortunately my clients want me focused on other things for that week!

summit’s picture

Subscribing, greetings, Martijn

darren oh’s picture

Status: Active » Closed (won't fix)

There is currently no maintainer for this version.