On my Drupal 7 site, I am using Views to over-ride the taxonomy pages, so I can control how they look.

Some of my taxonomy terms have fields and I want these taxonomy fields to appear on the View.

How can I do this?

I am using a Content Type View to over-ride the taxonomy pages. However, the Content Type View doesn't offer any options for adding fields that exist on the taxonomy terms.

If I create a Term Type View, then I can add the taxonomy fields to the View. However, this shows a field entry for every taxonomy term and not just those that are specific to the taxonomy term being over-riden.

I have tried every combination of the settings under contextual filters, but I have had no luck.

Thanks for any help.

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

If you think of how views works you would recognize that you can't display terms on nodes, because you will get multiple terms back.

Do you want to display taxonomy terms as the top of the view page?
If yes use the views area to embed another taxonomy term view on the header.

big_smile’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks for the reply!
I don't want to display the terms on the nodes.
I just want to override the main term pages and display the fields that associated with those terms.

Example:
I have a term called "home" (term ID 1) and a term called "business" (term ID 2) (which are both part of the same Vocabulary).

I have 6 nodes. 3 have the term of "home" , while three have the term of "business"
Each node has an image field, a heading field and a paragraph field.

Each term has an intro field that explains what the term is about.

I am using Views to over-ride the mysite.com/taxonomy/term/1 & mysite.com/taxonomy/term/2 pages (which I shall call "term index pages"), so I can display the image, heading, and paragraph fields of the nodes.

But I also want to use Views to display the term intro fields on the "term index pages". Business and Home both have different intro fields, so I only want the appropriate intro fields to display on the "term index pages" and not both of them.

It doesn't matter if I have to create a separate block View to display the term field, as long as I can embedded it on the main page View for the "term index pages".

Thanks for any help you can offer. I have been struggling with this problem for days!

dawehner’s picture

Status: Active » Fixed

So this issue is solved.

Use the view area on the header, and use an argument/contextual filter on the subview.

big_smile’s picture

Status: Fixed » Active

Thanks for your continued help.

Use the view area on the header, and use an argument/contextual filter on the subview.
Could you elaborate on this, or point to a resources that explains what to do?

As mentioned in the opening post, I have created a Content Type View to shows the node fields and a Term Type View to show the term fields.
The Content Type View works fine for showing node fields.
However, the Term Type View shows every term intro field entry (for both Business and home), and not just the single intro field entry that belongs to the specific term.

I have tried every combination of the settings under contextual filters for the term type view, but I have had no luck.

(Also, sorry for changing the status to active, but I have been struggling with this problem for days, and have not be able to find a solution on the Internet).

merlinofchaos’s picture

Status: Active » Fixed

You shouldn't have to do much. Just adding the vocabulary ID contextual filter should work, but you'll need to make sure the vocabulary ID you need is in the URL. It's nowhere in the URL in taxonomy/term/1 and that makes it not easy to get.

Status: Fixed » Closed (fixed)

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

int_ua’s picture

I've just:
1. Disabled Page display
2. Created a Block display in the Taxonomy Term view
3. In the Block display options changed:
Advanced -> Contextual filters -> Content: Has taxonomy term ID (with depth) -> When the filter value is NOT available -> Provide default value -> Taxonomy term ID from URL , checked "Load default filter from term page".
4. Placed this block in the custom region after the content region.
It displays all taxonomy term fields as I set them on admin/structure/taxonomy/%vocabulary%/display and all related terms in the block.
Now I just need to get rid of the built-in renderer of the related content...

int_ua’s picture

Status: Closed (fixed) » Active

Need some help with the last problem.

int_ua’s picture

That somewhat helped:
http://drupal.stackexchange.com/a/31398/7177
Any better method?

jensimmons’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)
traudong’s picture

I do have a better method. You can follow these steps:

1. RELATIONSHIPS --> add Content: Taxonomy terms on node --> choose the vocabulary that you want

2. FIELDS --> add the taxonomy fields that you want. The fields will be duplicated with each node displayed. So, if you dont want that, tick on Exclude from display checkbox

3. FORMAT --> Settings --> Group any field that you want (excluded from display in step 2)

That's it

Kartagis’s picture

Sorry for hijacking this issue, but how can we do this with a product display view? The said "Taxonomy terms on node" doesn't exist for me.

sundevil’s picture

Thank you traudong!

This has been a complex solution that I have been working on for some time now. Your comment added the finishing touch toward correct functionality. I may consider making a video tutorial, given the amount of people that seem to have encountered an issue with this.

traudong’s picture

Sure, video would be good. It took me a bit of time experimenting to find that solution because I was quite new to Views then.

@Kartagis: you probably had that solved already but in case anyone else having the same issue, I believe that updating Views to the latest version will solve it.

ronaldbijker’s picture

Thank you @traudong! Found this page through Google and this was exactly the answer I was looking for!

robert_t_taylor’s picture

Thank you, traudong! #11 was the clue I needed to remember how to accomplish this.

For others who may be struggling, also remember to actually add the taxonomy term to at least one of the pages/nodes that you are trying to access it from.