2

I have to create 1 view using taxonomy.

Let's take the example i have 8 categories: cricket, football, tennis, swimming.

I have to show this each category with their 5 latest articles.

Thew views should display database like

  1. Cricket

    1. List item
    2. List item
  2. Football

    1. List item
    2. List item

Like this all 8 categories with grid layout and 4 categories in row.

Right now what i am doing is creating 8 different views and showing on 1 page.

But this create issue when i am adding new category.

So it's dynamic view can help or i have to write code for this.

3
  • Try passing the top level tid to views as argument
    – niksmac
    Dec 6 '12 at 5:57
  • If we pass top level tid(parent id), we can get only sub terms details tid, term name and term description. Is it any way to get tagged article details?
    – Sathiya
    Dec 6 '12 at 9:18
  • You have to use "Views arg parent term" module to pass parent term id as views argument. drupal.org/project/views_arg_parent_term
    – Sathiya
    Dec 6 '12 at 9:18
1

This is fairly simple in Drupal 7 with the help of EVA: Entity Views Attachment. You are able to then create only two(2) views.

The first view will render all your categories you have in taxonomy as well as calling in the second view into a field of this view.

Your second view will then display the entities associated with the taxonomy term, You will have to create a Term reference in your content types in order to have a field in your entity view to check against.

I have previously done this where there are categories or terms displayed with a list of entities below them, all displayed in a grid view. See Example below.

enter image description here

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.