Drupal Sorting Nodes without Views
How do I sort the output of node listings without using Views?
I already created my template for my Node listing based on a category
the listing is under this URL f开发者_Go百科ormat:
/taxonomy/term/53
and using a template
page-taxonomy-term-53.tpl.php
I've created a CCK field (weight) under each node for me to sort with.
TIA
In page-taxonomy-term-53.tpl.php you haven't access to objects of nodes, just already themed $content. You can write here custom snippet that will sort term, but i recommend other way:
If "/taxonomy/term/53" provided by taxonomy module (not views), add this function theme_taxonomy_term_page($tids, $result) as YOURTHEMENAME_taxonomy_term_page(...) into your template.php and do custom sorting on $result object (get theming code from taxonomy.pages.inc).
精彩评论