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

  • Home
  • SEARCH
  • 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 8026817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:36:40+00:00 2026-06-04T23:36:40+00:00

Using Drupal 7, I have a content type: Movie, It has a taxonomy of

  • 0

Using Drupal 7,

I have a content type: Movie,

It has a taxonomy of actors: Keanu Reeves, Christian Bale, Milla Jovovich, etc.

I’d like to build a view which lists the actors taxonomy with a count of content matching the taxonomy term, for example:

Keanu Reeves (4)
Christian Bale (8)
Milla Jovovich (2)

I’m not sure how to build this view,

I’ve set a view with use aggregation, filter: =published, content type=movie, lang=users language,

fields: COUNT(Content: Actors)

It doesn’t seem to accomplish my goal, please help!

  • 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-04T23:36:42+00:00Added an answer on June 4, 2026 at 11:36 pm

    Couldn’t find a way to implement via view, here’s a custom block code to replace the view.

    $vid = 3; //vocabulary id
    $num_term = 8; //limit maximum terms
    
    $query = "SELECT tid, name, count
    FROM (
    SELECT td.tid AS tid, name, COUNT(td.tid) AS count
    FROM taxonomy_term_data AS td
    JOIN taxonomy_index AS tn
      ON td.tid = tn.tid
    JOIN node AS n
      ON n.nid = tn.nid
    WHERE td.vid = ". $vid ."
      AND n.status = 1
    GROUP BY td.tid
    ORDER BY count DESC
    LIMIT ". $num_term . "
    ) AS t
    ORDER BY name ASC";
    
    $result = db_query($query);
    foreach($result as $term) {
    if ($term->count > 0) {
      echo l($term->name, "taxonomy/term/$term->tid").' ('.$term->count.')'.'<br/>';
    }
    }
    
    ?>
    

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

Sidebar

Related Questions

I have a taxonomy vocab assigned to a content type in Drupal 6. I've
I have Drupal with CCK, I have a content type named Article. This Article
I have my own content type made in my module. It has text and
I've created a (modest) question answers system in Drupal. I'm using forum content type
I have a question in drupal I want to make a content type that
I have a drupal English/French website. I have a custom content type called 'ad'
I am using Drupal and have sifr set on list items, and also a,
I'm using Drupal 6 and have created 2 equal columns in layout.css In the
I have this website iloveforwards.com created using drupal. I would like to have a
I am using Drupal 6.13, Views 6.x-2.6, Voting API 6.x-2.3, Fivestar 6.x-1.18. I have

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.