I'm using
Views 7.x-3.x-dev (2011-May-11)
Ctools 7.x-1.x-dev (2011-May-10)

I am trying to create a glossary-type Attachment view to place above a view of an item list organized by taxonomy terms. But when I add the content term as a contextual filter, there's no provision to rewrite the Term ID as the Term Name (if I have my nomenclature right), or just use the Term Name directly. As a result, the Attachment is pretty useless, showing only the numerical Term IDs as an index to the content in the view below. Am I going about this wrong?

Comments

dawehner’s picture

This is quite confusing for me.

Can't you add a taxonomy: ID as contextual filter and a taonomy: name as field?

David D’s picture

Yes, I can add a taxonomy name as a field, but not as a contextual filter, as far as I can figure out. Taxonomy terms can only be used as contextual filters using their ID, not their name. So the resulting glossary index attachment just shows numbers, which of course are meaningless for users.

Does that help to clarify?

merlinofchaos’s picture

Category: feature » support
Status: Active » Fixed

To get the name you must add a relationship, either on the field or the generic taxonomy relationship. Then you can add any fields for that term as a contextual filter, including the name.

David D’s picture

Thank you, it works!

Status: Fixed » Closed (fixed)

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

dqd’s picture

Status: Closed (fixed) » Active

But there still seems to be a logical error between the UI and the query handling, Merlin. To get the taxonomy term name option shown up in contextual filters you have to set up a relationship between content and taxonomy on one or both sides first, right? As you sad. But than, if I do so, I sadly have to deactivate the relationships again, because otherwise I have tons of double copies of each node shown, sometimes 6 times a node. Funny is, the contextual filter taxonomy term name option, which I have selected while the relationships where set up, still works and shows now correctly the one wished item of each node, even if the relationships are removed, what I had to do to prevent from 6 duplicate items of each node. Even if I may didn't understood it all completely right here and how to do it, there must be an error on it, the one way, or the other way around. Didn't it?

dawehner’s picture

Which relationship did you used? Did you used the one provided by the field or the general integration?

dqd’s picture

@dereine, I assume you ask about the choice on the left side in the setting of the particular field with the relationship selector at one hand, and the options at right under relationships on the other hand? (both under view/edit of course)

Well, the choice on the term field in this example left under field settings only occurs if you turn on the particularry needed taxonomy node and term relationships at right. So been sad: You need both. At least here with my setup. D7.2, views and ctools latest dev shot.

The boat I came in here with was, to get working a SEO-optimized sense-making path alias from the same rootpath to content listed under term names with views module, like news/culture and news/sport where news is the vulcabulary and sport or culture is the term. Regulary there is only an option to check the term id in the url with contextual filters but not the names. So you need to setup relationships before term: names occurs in contextual filters.

Thats all I can clear from my side so far. Does it help you to understand what I talk about? Because, I am not sure, if we talk about the same thing, to be honest. It has to do with my trouble getting deep enough into the logic of views in the moment. Sorry for hijacking this thread. I wanted to avoid another thread with almost the same trouble. I still wonder what I do wrong because I thought this should be something working at the first spot in general.

Thanks for jumping in! By the way, from your nickname, are you from Germany? (like me?)

thanks a ton and kind regards,
Digidog

dqd’s picture

ok, to clearify:

There was too many I didn't realize first, because of missing documentation at views 3 I wanted to read and my ovrnightly tireness.
(sorry for saying this, this is NO critic, because views is an awesome and very impressing powerful module set which is available here. thank you all for that!)

Finally I simply didn't realize something really dump, meaning that the preview section below resets after pressing save made me think the relationships break the display of content completely in that view. But it was only because of the url input field for filtering terms of the preview section was cleared off after pressing save. omg. I am sooo st...

dawehner’s picture

Status: Active » Fixed
There was too many I didn't realize first, because of missing documentation at views 3 I wanted to read and my ovrnightly tireness.

OMG, we found someone who want to work on the documentation. That's really great...
Feel free to help where you can.

Update status.

dqd’s picture

thanks for asking :-)
... show me where to start. (Priorities)

in the interests of clarity:

(sorry for saying this, this is NO critic, because views is an awesome and very impressing powerful module set which is available here. thank you all for that!)

... is what I also sad. The other sentence before was just for explaining my error, not for complaining. And yes, I give back where I can.

Status: Fixed » Closed (fixed)

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

wernerglinka’s picture

I had the same problem and found this thread but the suggestion at #3 is not clear to me. I found very clear instructions here: http://drupal.stackexchange.com/questions/9332/drupal-7-views-contextual...
This was quite a head scratcher.

rahul_sankrit’s picture

Issue summary: View changes

Contextual filters settings with term alias instead of term id.

Contextual filters settings for category name:

1. Go to Home » Administration » Structure » Views
2. In Advanced Tab » Contextual filters » Add a new "Content: Category (field_category)" contextual filter.
3. Under "Provide default value" select Raw Value from URL and path component(as per menu path or URL).
4. Under the form "When the filter value IS in the URL or a default is provided" select the option "Specify validation criteria".
5. Select "Taxonomy Term" as the Validator.
6. Select "Category" from vocabularies.
7. Under "Filter Value Type" select "Term name converted to term ID".
8. Check "Transform dashes in URL to spaces in term name filter values" : If we have multiple-word taxonomy terms, we should allow the contextual filter to convert dashes in the URL into spaces for the term name.
9. Save the changes and visit the page.

Thanks

Bruno Vincent’s picture

#14 almost works but not quite...

How to display something like:

animals/pets/cats

I can only get this working for cats now in the "Preview with contextual filters:" field

matsbla’s picture

#14 works great!

However, the alternative "Transform dashes in URL to spaces in term name filter values" doesn't seem to work for me, it only work when I write the term name exactly as it is written directly in the URL, but not as machine name.

Marcel Tuchek’s picture

Rahul, you rule! Thanks! #14 rocks it! ;-)