I'm unable to find clear documentation on how to create a view of nodes and use their taxonomy terms to sort them by the weight of the taxonomy they are related to.

#150896: Sort on Taxonomy: Terms for [your vocabulary] is a related feature request thread which contains some references (below) but no clear solution.

* #158859: Table View Sortable=yes is not sorting the table
* Forum thread on Views Sort Criteria & taxo relations
* #495908: Support node sort by taxonomy vocabulary
* Screencast on Views Relationships
* #272424: Sorting doesn't work in view
* Workaround with computed fields
* hanoii's comment indicates some success
* xurizaemon's comment with one solution

If someone can outline the recommended Views2 approach for doing this, I'd be pleased to assist in documenting it better.

This issue has been opened in an attempt to get a no-patch solution documented. This is a documentation/support request thread only, but I'm happy for it to be closed if the maintainer feels that it's not helpful to create a separate docs issue related to the thread(s) linked above.

Comments

esmerel’s picture

Assigned: Unassigned » esmerel
iamjon’s picture

grobot
did you ever find a solution for this? if yes please update and I'll write up a patch to document it.
if not let's see what we can come up with.

xurizaemon’s picture

Title: Document process for sorting a node view by taxonomy term » Document process for sorting a node view by taxonomy term (various edge cases)

@iamjon: One solution I used was this one (linked above), but the fact that I opened this issue several months later suggests it wasn't a fix for all situations. If I recall which view I was working on I'll update the ticket.

I think we might need to write up various use cases and solutions here, because sort actually works in the most basic usage, it's just "everything else" which doesn't always work out of the box. IMO what's catching people is not the basic functionality, but secondary requirements which need consideration for each case (" ... where the node has terms in multiple vocabularies", " ... where the taxonomy term weight does not match alphabetical sort", " ... where P != P").

Some edge cases; please expand if you think this is a good approach -

merlinofchaos’s picture

We can call this document "Why I hate taxonomy". =)

anrikun’s picture

Version: 6.x-2.8 » 6.x-2.x-dev

Any news about this issue?
(@esmerel: are you really working on that???)

I have 2 vocabs: A and B.
Nodes may have one term from A and one term from B.

I want to list nodes this way:
- term X from vocab A
--- node 1
--- node 2
--- node 3
- term Y from vocab B
--- node 1
--- node 4

It works except that term from vocab B is listed before term from vocab A...
Changing vocab weights has no effect.

anrikun’s picture

Just added #1056170: Sorting: order by vocabulary weight
Please review the patch.

iamjon’s picture

There is also the lineage module
http://drupal.org/node/612908

And views hacks also has a taxonomy hierchy summmary http://drupal.org/project/views_hacks#views_summary_taxonomy

Tripplefix’s picture

Status: Active » Fixed

Thank you all for your postings and your effort with it. Is this issue still valid? The last two posts suggest help - did they help? I set this to fixed, because there were no actions for such a long time.

Tripplefix’s picture

Issue tags: +dvcs11

Forgot to tag...

Status: Fixed » Closed (fixed)
Issue tags: -dvcs11

Automatically closed -- issue fixed for 2 weeks with no activity.