Hi,

I am using a viewfield as field in a taxonomy, using 2 arguments and it seems not to work, although it works perfectly with one argument.

This is what I have done:
- I have created a view with 2 taxonomy term arguments from 2 different vocabulary: "discipline" and "type of resource", and test it with two values: it worked well.
- I then added the viewfield to the taxonomy "type of ressource", with the following arguments:
[current-page:url:arg:1], [term:tid]
--the first argument takes the discipline from the url of the page the final view is diplayed on (the url is like mysite/disciplines/term/[tid])
--the second argument is the tid of the type of resource the viewfield is linked to.
When I go to the page mysite/term/[tid], the view doesn't display anything.
Actually, it seems that it is the argument [current-page:url:arg:1] that does not work.

What am I doing wrong?

Any help would be greatly appreciated.

Comments

keithm’s picture

I suggest you experiment trying to get a viewfield working with a single [current-page:url:arg:1] argument first, then add the second argument. I'm not clear on exactly where your problem is.

audealexandre’s picture

Thanks for your fast answer!

I found on http://drupal.org/node/1265010 that the syntax of [current-page:url:arg:N] has been modified to [current-page:url:unaliased:args:value:N]. After testing it, and making it [current-page:url:unaliased:args:value:2] (and not [current-page:url:unaliased:args:value:1]) because of the url syntax mysite/taxonomy/term/[tid] on another view, the argument works, too... but still not on my first view with the 2 arguments.

I wondered if it is not due to the fact that my view with two arguments is actually displayed as a field in the final view which is displayed on the page mysite/taxonomy/term/[tid]. Could that be the problem? Could it be that the first view cannot access the page url argument?

Many thanks in advance for your help,

audealexandre’s picture

My failure, sorry for disturbing: as a matter of fact, I had created the viewfield on a taxonomy that already existed before, and specified a default value, but not choosing "always use the default value". Then, obviously, there was no value for this field on my taxonomy terms. Choosing "always use the default value" did the all thing work.
Thanks again for your help,

audealexandre’s picture

Hopefully this helps somebody else :-)

keithm’s picture

Status: Active » Closed (fixed)