好的,所以这可能是一个愚蠢的问题,但我想我还是把它放在那里:
我知道这是一个简单问题的奇怪解决方案,但我需要控制分类页面中节点的列表,我不觉得我有传统的方式。所以我继续创建了一个模块来获取基于分类的节点(taxonomy_select_nodes()),我想要一个寻呼机来配合它。
这是代码:
function theModule_recipeList(){
$path = drupal_get_path_alias($_GET['q']);
$args = explode("/",$path);
$themePath = drupal_get_path("theme", "theTheme");
$term = taxonomy_get_term_by_name($args[1]);
$tid = $term[0]->tid;
$nodes = taxonomy_select_nodes(array($tid));
$output = "<div id='recipeListWrapper'>";
while($row = db_fetch_object($nodes)){
$node = node_load($row->nid);
if($node->uid != 1){
$userClass="user";
}
else{
$userClass="admin";
}
$output .= "
<div class='receptThumbnailWrapper'>
<div class='wrapper'>
<img src='".base_path().$themePath."/graphics/recept-default-small.png' />
<h3><a href='".base_path() . $node->path."'>".$node->title."</a></h3>
<div class='recipeType $userClass'></div>
</div>
</div>
";
}
$output .= "</div>";
return $output;
}
现在,该模块按我的计划工作并且全部工作(即使它是一种管道胶带解决方案,我知道),并且寻呼机打印并工作。问题是寻呼机在其他任何东西之前打印。
我怀疑这是因为我在返回 $output 之前调用了 taxonomy_select_nodes,但我需要它来获取我想要的节点。
请,非常感谢任何建议。
/安德斯