Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9163967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:34:06+00:00 2026-06-17T14:34:06+00:00

I use drupal 7.18. I created a content type ‘company’ with term reference field

  • 0

I use drupal 7.18. I created a content type ‘company’ with term reference field ‘location’. The taxonomy ‘location’ has tow levels ‘continent’ and ‘country’. I went to list all ‘company’ node grouped by ‘continent'(the top level of the taxonomy ‘location’).

I question if this option is available in the views module or i should alter the query?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:34:07+00:00Added an answer on June 17, 2026 at 2:34 pm

    Yes, you can actually do that with views without any custom coding.

    Scenario 1

    It would be easiest if you tag your company nodes with both the continent and country terms when you tag them. If that is the case, you can simply add the term in the field list of your view and then group by that field.
    Once you’ve added the term as a field, click on the ‘Settings’ link next to your view’s format. There you will see an option to ‘Group by’ any of the fields you’ve added to your view. It may then be repetitive to also display the continent, so you can just select to exclude it from being displayed.

    Scenario 2

    It is also possible that you select the country tag (child term) without selecting the continent term (parent) in the country nodes. If that’s the case, you won’t be able to add the continent as a field and then group by it (since it isn’t selected for the node, it isn’t a field for that node). In that case you need to add two relationships to your view (Relationships are added in the ‘Advanced’ section of your view) first to get to the parent term.

    • Add ‘Content: location’ as your first relationship (and you can check that it should be required if you only want to list companies that have been tagged with this in your view).

    • Next add the relationship ‘Taxonomy Term: Parent term’ and make sure to use the ‘Content:location’ relationship when you set this up. That will pull up the parent term of the tagged location automatically.

    • Next add the ‘Term: Name’ field in your list of fields, and at the top select to use the ‘Parent term’ relationship you set up previously.

    • Finally, now that you have the parent term printed out in your view, you can group by it the same way as I described earlier — by clicking on ‘Settings’ next to your format and selecting this field as the one you should group by.

    I hope I explained this clearly. Let us know if it works for you or if you have questions!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a content type: battle in which a field is a node reference
I have created a custom field on a content type in Drupal 7 which
I'm new at drupal. I created custom content type with CCK. Added some Phone,
In Drupal I have the page content type. I have created a vocublary and
I am using Drupal 7 and have created a custom content type and a
I've created a content type in Drupal 7 with 5 or 6 fields. Now
[For Drupal 6] Let's say I've created a content type called my_content_type. I can
My Drupal 6 installation has the php filter disabled so I can't use <?php
Anyone know how to use Google Analytics for a Drupal-powered company intranet site behind
I've just started learning how to use Drupal 7. I made a new content

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.