2

I have the following taxonomy structure:

Locations

  • Group 1
    • Location 1
    • Location 2
  • Group 2
    • Location 3
    • Location 4
  • Group 3
    • Location 5
    • Location 6

Pieces of content are being posted to the site, and each piece of content has a location and a post date associated with it. When the view is displayed, how can the results be grouped by parent term ID (group 1-3), and then grouped by post date within each group?

I've tried using the "taxonomy term: name" sort criterion, but then adding the "content: post-date" criterion seems to have no effect.

  • Is your list of Groups small or large? Is it static? I can think of a round-about way to do this, but it won't be a good solution unless the parent terms are pretty static. :-( – Boriana Ditcheva Jan 15 '13 at 21:54
2

I think I found a way to do this--I added the "content: taxonomy terms on node" and "taxonomy term: parent term" relationships to the view.

The key is the "taxonomy term: name" criterion has a checkbox where I selected "parent", which appears only after you add the relationship. I added the post-date sort criteria after that, and it appears to be working the way I want.

  • I recently discovered that the sort works better if you require the relationship because it uses inner joins instead of left joins. – Darvanen Sep 2 '15 at 23:13
0

For really simple sorting, such as it's outlined in the question it's easy but took me a while to find it (no relationships needed):

  1. Add taxonomy term as a field and exclude it from the display.

    Make sure you have the title field still in the display.

  2. Then under Format, click on "settings" to the right of "format:"

  3. Under "Grouping field Nr.1" choose the taxonomy term field.

Now all your content should be grouped according to their respective term:

  • Term Name 1
    • Item 1 Title
    • Item 2 Title
  • Term Name 2
    • Item 3 Title
    • Item 4 Title
  • Term Name 3
    • Item 5 Title
    • Item 6 Title

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.