Hello,
I am creating a view of a taxonomy with a contextual filter by taxonomy parent.
I can't find if there is a way to make the overriden title fetch the name of the parent taxonomy term, or to fetch it myself, because right now I am only able to display its tid, using %1.
I wonder if there is a way to do this?
Thanks for any information on this and sorry if it is very obvious, I'm quite new at this.

Comments

merlinofchaos’s picture

Status: Active » Fixed

%1 will be the name of the taxonomy term actually passed in. I'm guessing from your phrasing that's not the parent.

IN the very latest -dev version of Views, you can also use tokens from the first row in the title. That will get you what you want.

somezing’s picture

In the taxonomy view %1 displays the taxonomy ID of the term and not its name, as opposed to what happens when using the same settings in a content view, where the term ID is automatically replaced by its name. This happened both using the current term shown ID through the contextual filter's title override as well as using the current term's parent ID. In all instances I will only get the ID. I assume that is a functionality not available in this kind of view?

(I will wait for the next version to be able to use tokens in the title, for the moment I am using a grouping field as the title unless there is a way to do it through the title overrides... This way I get 2 titles which is kind of unnecessary..)

Thank you.

merlinofchaos’s picture

If %1 isn't getting the title, try adding taxonomy term validation. Depending upon the argument you use and the way it validates, it might not be smart enough to automatically convert the tid to a term name, but the validator will do this regardless of what the argument is. Plus, the validator can also reject terms that aren't valid preventing bad queries.

somezing’s picture

Ok, that's weird, I think.
I was already validating using:
validation: taxonomy term
filter value type: term ID
changing
filter value type to: Term Ids separated by , or +
made it work as expected.
I don't know if that's the way it's supposed to be? I hadn't tried that option earlier because I am only supposed to be getting one term ID, so I thought that was the most appropriate option.
Thanks a lot :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

anou’s picture

Issue closed but i wanted to confirm that comment #4 is the solution at the moment. If you choose filter value to "Term ID" only, it won't work has expected...

Wappie08’s picture

Version: 7.x-3.0-beta3 » 7.x-3.x-dev
Status: Closed (fixed) » Active

Yep, #4 works! Really strange.. had to find this thread to learn the trick (so not very logical). Please close again if works as designed!

Greets Wappie

ñull’s picture

Title: Contextual filter title override using taxonomy parent » Contextual filter title override using taxonomy
Category: support » bug

This issue is not only for parent id, so I changed the title accordingly.

I wonder why it should only do id to text conversion with only that validation. What sense does it make to have the id number in the title at all? That looks like a bug to me. In D6 views I never had this issue. When this works as designed, then the descriptions of these functions should warn the user of this. So no matter how you look it is it remains a bug.

dawehner’s picture

Status: Active » Closed (duplicate)

Afaik this should have been fixed with #1307162: Undefined index: 0 in taxonomy_term_load() Error

patoshi’s picture

adding my 2 cents to this.... This was a very weird setup i must say.

I wanted to page title be dynamic and have the taxonomy id term show up via views3. At first I had in override title as "%2", to grab the 2nd argument in the URL, but that doesnt work for some reason. You have to do a %1 to grab the 1st argument, im guessing its grabbing the contextual filters argument selection, not URL.

here is my screenshot: http://prntscr.com/6drgo

hope this helps someone.. and best that someone makes this clearer.