【问题标题】:Drupal Sorting Nodes without Views没有视图的 Drupal 排序节点
【发布时间】:2011-02-16 09:44:48
【问题描述】:

如何在不使用视图的情况下对节点列表的输出进行排序?

我已经根据类别为我的节点列表创建了模板

列表采用以下 URL 格式:

/taxonomy/term/53

并使用模板

page-taxonomy-term-53.tpl.php

我在每个节点下创建了一个 CCK 字段(权重)供我排序。

TIA

【问题讨论】:

    标签: drupal sorting cck taxonomy


    【解决方案1】:

    在 page-taxonomy-term-53.tpl.php 中,您无法访问节点对象,只是已经以 $content 为主题。您可以在此处编写自定义 sn-p 来对术语进行排序,但我推荐其他方式:

    如果分类模块(不是视图)提供“/taxonomy/term/53”,请将此函数 theme_taxonomy_term_page($tids, $result) 作为 YOURTHEMENAME_taxonomy_term_page(...) 添加到您的 template.php 中,并对 $result 对象进行自定义排序(从 taxonomy.pages.inc 获取主题代码)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-12
      相关资源
      最近更新 更多