开发者

Drupal Sorting Nodes without Views

开发者 https://www.devze.com 2023-02-11 06:41 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消