Drupal Sorting Nodes without Views

626 Views Asked by At

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 format:

/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

1

There are 1 best solutions below

0
On

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).