Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/drupal/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Drupal搜索模块直接链接到评论_Drupal_Drupal Comments_Drupal Search - Fatal编程技术网

Drupal搜索模块直接链接到评论

Drupal搜索模块直接链接到评论,drupal,drupal-comments,drupal-search,Drupal,Drupal Comments,Drupal Search,在我的drupal搜索结果页面上,除了帖子本身,还可以直接链接到帖子的评论。查看search.module文件,相关代码似乎是 $output = ' <dt class="title"><a href="'. check_url($item['link']) .'">'. check_plain($item['title']) .'</a></dt>'; 问题是我不知道$item['link']到底从哪里来,也不知道如何获取其中注释的link变

在我的drupal搜索结果页面上,除了帖子本身,还可以直接链接到帖子的评论。查看search.module文件,相关代码似乎是

$output = ' <dt class="title"><a href="'. check_url($item['link']) .'">'. check_plain($item['title']) .'</a></dt>';

问题是我不知道$item['link']到底从哪里来,也不知道如何获取其中注释的link变量。您能提供的任何帮助都将非常好。

除了直接链接到节点本身之外,您还想链接到注释吗?这并不难

对于同一页面,您需要将输出更改为:

$output = ' <dt class="title"><a href="'. check_url($item['link']) .'">'. check_plain($item['title']) .'</a></dt><dd><a href="'. check_url($item['link']) .'#comments">'. check_plain($item['title']) .'</a></dd>;
当然,你们会想在主题上搞得一团糟