使用hook_theme函数,自定义渲染节点标题的HTML代码,其中包含加粗字体的样式。例如:
function mytheme_theme($existing, $type, $theme, $path) {
return array(
'node' => array(
'template' => 'node',
'variables' => array('elements' => NULL),
),
);
}
function mytheme_preprocess_node(&$vars) {
if (!empty($vars['node']->title)) {
$vars['title'] = '<span style="font-weight:bold;">' . $vars['title'] . '</span>';
}
}
这样,在节点标题中将会自动添加加粗字体的样式。