在comment.tpl中,打印$links以显示回复和编辑链接。在我的主题中,编辑先于回复。如何更改打印链接的顺序?
发布于 2010-07-26 01:12:36
查看hook_link_alter() -它允许你在链接呈现之前对其进行操作,例如删除一些链接或更改顺序。
发布于 2010-07-24 07:11:33
尝试在您的主题中使用template.php创建一个注释预处理函数。这将使您能够访问$links变量,并允许您重新排序元素。
发布于 2010-07-28 08:51:10
此函数将反转评论链接的顺序。把它放到你的template.php中(同样在添加了这个函数之后,清空你的站点缓存并访问/admin/build/template.php一次,以确保这个函数在主题注册表中被选中):
function phptemplate_links($links, $attributes = array('class' => 'links')) {
if (isset($links['comment_edit'])) {
krsort($links); // or ksort if you want to order your links the other way
}
return theme_links($links, $attributes);
}https://stackoverflow.com/questions/3322326
复制相似问题