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 为什么我能';t将自定义标记添加到用户配置文件_Drupal - Fatal编程技术网

Drupal 为什么我能';t将自定义标记添加到用户配置文件

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

我想向用户配置文件页面添加一些标记

在template.php中

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.”,
);
}

将钩子用于用户配置文件