Templates Drupal 7:如何定制用户配置文件?我如何将profile2字段添加到它?
“用户/n”下的配置文件将仅显示配置文件图片和用户名 我用的是欧米茄亚主题。 我复制并粘贴了默认的user-profile.tpl.php文件,删除了所有内容并添加了这两行,希望其中一行可以正常工作:Templates Drupal 7:如何定制用户配置文件?我如何将profile2字段添加到它?,templates,drupal,profile,field,Templates,Drupal,Profile,Field,“用户/n”下的配置文件将仅显示配置文件图片和用户名 我用的是欧米茄亚主题。 我复制并粘贴了默认的user-profile.tpl.php文件,删除了所有内容并添加了这两行,希望其中一行可以正常工作: print drupal_render(field_view_field('profile2', $profile['main'], 'field_nombrecompleto1')); print $field_profile_nombre_completo['value']; print "
print drupal_render(field_view_field('profile2', $profile['main'], 'field_nombrecompleto1'));
print $field_profile_nombre_completo['value'];
print "<pre>";
$vars = get_defined_vars();
print_r($vars);
print "</pre>";
第二行是指原始的core profile字段,第一行是指导入的字段(在升级到D7之前,我使用D6中的迁移模块导入)
没有一个字段被打印出来。
我在模板顶部添加了以下内容:
在某些点上,它实际上识别(岩芯剖面)字段:
然后我删除了我的用户配置文件模板中的所有内容,只打印了XXXXXX,但没有打印出来。它仍然打印配置文件图像和用户名
现在我有两个问题:
如何自定义配置文件模板(user profile.tpl.php),因为它无法识别我的主题文件夹中的文件,以及如何打印用户配置文件中的profile2字段信息。
希望有人能给我一些见解或线索。
谢谢
Rosamunda我认为默认情况下,profile2字段在用户配置文件页面上的单独选项卡页面上呈现。
您应该能够使用函数-1获取用户配置文件字段,而无需任何解释?请不要交叉发布到多个站点。
[template_file] => sites/all/themes/liga/templates/page.tpl.php
[content] => Array
(
[content] => Array
(
[system_main] => Array
(
[field_profile_nombre_completo] => Array
(
[#theme] => field
[#weight] => 0
[#title] => Apellido y Nombres
[#access] => 1
[#label_display] => hidden
[#view_mode] => full
[#language] => und
[#field_name] => field_profile_nombre_completo
[#field_type] => text
...