gpt4 book ai didi

drupal-7 - 在标题节点之前显示字段 drupal 7

转载 作者:行者123 更新时间:2023-12-03 06:44:12 25 4
gpt4 key购买 nike

我想在标题前显示节点的标签类别,标题字段在界面中不可用,有没有办法在node.tpl.php或page.tpl.php中做到这一点(我不会安装另一个像 ds suite 这样的模块就是为了这个目的)。PS:我想在显示节点的所有地方都执行此操作。

最佳答案

你可以:

  1. 在您的 page.tpl.php 中,您的标题被回显,将标题包装在 if 语句中,以便在您位于节点页面时不显示 $title
    if(arg(0)!='node'):      if ($title ):         print $title;      endif;     endif; //print title only if i am not on node pages
  1. 现在您可以在 node.tpl.php 中的任何位置打印 $node->title

还有其他方法可以在自定义模块中执行此操作,听起来更有效,但如果这是一个小任务,我想编辑您的 tpls 是一个很好的解决方案

关于drupal-7 - 在标题节点之前显示字段 drupal 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12874653/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com