Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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
Css 从最近的内容块Drupal 7中删除用户名_Css_Drupal_Drupal 7 - Fatal编程技术网

Css 从最近的内容块Drupal 7中删除用户名

Css 从最近的内容块Drupal 7中删除用户名,css,drupal,drupal-7,Css,Drupal,Drupal 7,我正在使用Drupal7和Garland主题。最近的内容块当前显示最近修改的节点标题的名称加上相应用户的用户名 我想从显示中删除用户名。 我不接受使用视图模块的解决方案 非常感谢 您需要修改Garland主题,这样它就不会在该块中显示用户名。通过在/themes/Garland/template.php的末尾添加以下代码,可以直接在Garland主题中执行此操作: /** * Returns HTML for a recent node to be displayed in the recen

我正在使用Drupal7和Garland主题。最近的内容块当前显示最近修改的节点标题的名称加上相应用户的用户名

我想从显示中删除用户名。 我不接受使用视图模块的解决方案


非常感谢

您需要修改Garland主题,这样它就不会在该块中显示用户名。通过在/themes/Garland/template.php的末尾添加以下代码,可以直接在Garland主题中执行此操作:

/**
 * Returns HTML for a recent node to be displayed in the recent content block.
 *
 * @param $variables
 *   An associative array containing:
 *   - node: A node object.
 *
 * @ingroup themeable
 */
function garland_node_recent_content($variables) {
  $node = $variables['node'];

  $output = '<div class="node-title">';
  $output .= l($node->title, 'node/' . $node->nid);
  $output .= theme('mark', array('type' => node_mark($node->nid, $node->changed)));
  $output .= '</div>';

  return $output;
}
/**
*返回要在最近的内容块中显示的最近节点的HTML。
*
*@param$variables
*包含以下内容的关联数组:
*-节点:节点对象。
*
*@ingroup主题表
*/
函数garland\u节点\u最近\u内容($variables){
$node=$variables['node'];
$output='';
$output.=l($node->title,'node/。$node->nid);
$output.=主题('mark',数组('type'=>node_-mark($node->nid,$node->changed));
$output.='';
返回$output;
}
只需保存并清除所有缓存(在“管理性能”下)

但是,我建议您创建一个Garland主题的副本,并在/sites/all/themes/下创建一个新主题。然后在那里修改template.php。这就是为什么如果你升级了,你就不需要修改了(因为Garland是Drupal核心的一部分)