我如何在注册页面上查看配置文件字段?
-
02-10-2019 - |
题
我制作了自定义的用户注册页面。我已经在主题层上了。
但是现在我想查看我在配置文件模块中所做的字段。
就像我这样写的那样
<?php print drupal_render($form['account']['name']); ?>
此代码将显示用户名字段。默认值。现在,我想查看我在配置文件模块上创建的配置文件字段。
那么,有人可以告诉我我在drupal_render [?]中必须写的是什么?
提前致谢。
Nitish
Panchjanya公司
解决方案
首先,如果您使用的是Drupal 6,您可能想知道您可以选择一个复选框, 出现在注册页面 当您从管理UI创建新的用户配置文件字段时,它会显示出来。
否则您可以尝试一下。
$categories = profile_categories();
foreach($categories as $category) {
$result = _profile_get_fields($category['name']);
# You can add code here to render each category seperately #
while($field = db_result($result)) {
$fieldname = $field['name'];
drupal_render($form[$category][$fieldname]);
}
}
不隶属于 StackOverflow