2

How can I create a view and show only taxonomy terms related to the term you are currently viewing (term id in URL)? I have tried a handful of relationship and argument configurations, but can't seem to simply list the related terms to the term being viewed.

Edit: I have related the terms through the core taxonomy interface.

  • 1
    did you relate the terms them by assigning them to the same parent term? – uwe Feb 23 '12 at 4:42
1

I have done the same thing through Panels. I was stuck with views for a long time. All you have to do is to override the "Taxonomy Term Template" in panels. Add a new Variant with settings of your choice (default ones would be fine too). Go to 'content' section and add new one. Choose 'list of related terms' and inside it you would find the related terms you need. Make sure you give it a valid path and there you have it!

I don't know how this could be done in views but for me this is more than fine.. :)

  • sorry Ali i binned Panels a few years ago now. I found it slowed my site down. I try and do whatever Panels does for me manually. Thanks for the suggestion though. – Reg Gordon May 4 '12 at 15:46
  • You are right. It does slow down the site a bit. If you find a solution of doing this in views, please do post it here. Thanx.. – CobaltBabyBear May 5 '12 at 4:49
  • 1
    If you set up caching in Panels properly it won't slow your site down. Sony Music hosts all their artists' sites using Panels; the module was designed to handle heavy traffic loads. – Patrick Kenny May 5 '12 at 11:14
  • This should be doable on a site without having to throw Panels at it. – Kevin May 7 '12 at 18:49
1

I assume by related that you want parent, sibling and child relationships.

Parent: A view to identify a parent can be provided by a view page defined with a path such as category/% where the % wildcard is a term's name. A relationship should be defined for the taxonomy term:parent. The view should expose whatever fields you want such as the term name, but leave the relationship dropdown box set to 'Do not use a relationship'. Set a contextual relationship for the term name and set the relationship dropdown as 'Parent'. (You must also set validation to a taxonomy term name so that the URL wildcard name will be interpreted correctly.

Children: I answered this pretty thoroughly in this post.

Siblings: I worked at this one for a while before finding this post which suggests that it is not possible without the aid of Page manager. Sorry, but I was not able to find a way to do it with views alone.

My post uses D7 a V3 so there will be some differences in the UI to execute this, but I believe that the settings and basic configuration are the same with the exception that conceptual filters = arguments.

1

I know this question is older but I needed to be able to search for content via Views that showed results including Term Parents, Children & Siblings (All optionally depending on the view). I have created a module that adds some Views Filters for Term Families and also for restricting Search options to Terms on content (optionally allows adding related terms to the options):

http://drupal.org/sandbox/jpstrikesback/1844058

I'm not sure if you need to exclude the searched term or not, so just so you aware that is not in the feature set.

0

I think this can be done with 'entity references' (D7).

My goal was to relate a term ('steps') to another term ('goals'), and to have the 'steps' appear on the 'goal' page in a block.

  • Download entity reference module
  • Add an 'entity reference' field to the term (in my case, I added a entity reference field for 'goals')
  • Add a 'taxonomy term' type view
  • Add a relationship for 'entity reference' and the taxonomy field you would like to match
  • Add a contextual filter 'taxonomy term: term id', add the previously created relationship, and make the default action to take term id from url.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.