I remember coming across several discussions on this subject, including propositions for patches to the taxonomy module, but have not seen anything about it in the discussions on Drupal 4.7. I would be grateful for any enlightenment that anyone can provide.
Here's a brief statement of the problem: when you display a taxonomy term with its dependent nodes (eg: www.example.com/taxonomy/term/9), then the nodes are sorted by stickiness and descending creation dates, in other words anything sticky appears at the top of the list and the rest is sorted such that the most recent nodes appear at the top of the list.
In my case, however, I wanted to do something different: I use the taxonomy (and the taxonomy_context module) to group together articles submitted at various times in a "series", where (logically) I want the series to start at the beginning, in other words with the first, not the last submitted node. In other words, I want the nodes sorted by creation date ASCENDING.
I could find no easy way to do this using existing functionality and contributed modules, so I ended up doing something I hate: hacking taxonomy.module as follows:
- added a new field "sortorder" to "term_data" table
- added four new fields to the term definition form, to allow four separate sortorders to be defined in descending order of priority
- modified the SELECT statements which find nodes for a term, to include the sortorder defined for the specific term.
This works for me, but there are a whole series of reasons for not liking this solution:
- deviates from standard
- much work involved whenever upgrading to new version of Drupal
- a bit clunky?
I seem to remember that there was a suggestion for patching taxonomy.module to allow it to be called with different sort orders (which would then be defined in an external module somewhere), but have not been able to find out whether this has been done or not.
At all events, I am sure that this is an area which could be of interest to more people than just me.
Comments
I think you may have
I think you may have overlooked the ulta cool views.module for doing what you want!
--
Custom Drupal templates | More Drupal modules
--
Ixis (UK): Drupal support, Drupal hosting.
Views module in combination
Views module in combination with Taxonomy Redirect will do everything you want here, I think, *except* for next/previous on an individual node.
(That's something I want to do at some point.)
-- Merlin
[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
-- Merlin
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
Taxonomy redirect?
Could you explain what Taxonomy redirect is? A module?
I have already looked at the Views module, but have two problems with using it as things stand:
1) I want to get a list of titles/teasers - but all that Views seems to give me is a list of teasers without titles: am I missing something?
2) More to the point, I also want to be able to call functions of the taxonomy module to return a list of nodes sorted in an appropriate order (see my Shortcuts module). Can I also do this with Views? Is there a Views function I can call to return a list of nids/titles? That would be very useful!
1) Teasers should include
1) Teasers should include titles.
2) You can get programmatic results of a view; i.e, call a view and it will return either the database $result or a list of objects.
-- Merlin
[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
-- Merlin
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
Taxonomy Redirect is a
Taxonomy Redirect is a module for 4.7.
-- Merlin
[Point the finger: Assign Blame!]
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]
-- Merlin
[Read my writing: ehalseymiles.com]
[Read my Coding blog: Angry Donuts]