Drupal 为什么我能';t将自定义标记添加到用户配置文件
我想向用户配置文件页面添加一些标记 在template.php中Drupal 为什么我能';t将自定义标记添加到用户配置文件,drupal,Drupal,我想向用户配置文件页面添加一些标记 在template.php中 function athens_preprocess_user_profile(&$variables) { $markup = 'hello'; $variables['elements']['social'] = array( '#weight' => 0, '#markup' => '<div class="clearfix"></div><div class="a
function athens_preprocess_user_profile(&$variables) {
$markup = 'hello';
$variables['elements']['social'] = array(
'#weight' => 0,
'#markup' => '<div class="clearfix"></div><div class="author-social">' . $markup . '</div>',
);
函数预处理用户配置文件(&$variables){
$markup='hello';
$variables['elements']['social']=array(
“#权重”=>0,
“#markup'=>”.$markup.”,
);
但要注意更改:(用户配置文件.tpl.php模板使用
$user\u profile
进行输出渲染。您应该将自定义标记字段添加到用户配置文件
键
function athens_preprocess_user_profile(&$variables)
{
$markup = 'hello';
$variables['user_profile']['social'] = array(
'#weight' => 0,
'#markup' => '<div class="clearfix"></div><div class="author-social">' . $markup . '</div>',
);
}
函数预处理用户配置文件(&$variables)
{
$markup='hello';
$variables['user_profile']['social']=array(
“#权重”=>0,
“#markup'=>”.$markup.”,
);
}
将钩子用于用户配置文件