【问题标题】:drupal 7 profle2 in single page with standart带有标准的单页drupal 7 profile2
【发布时间】:2012-06-25 11:27:26
【问题描述】:

如何在一个页面中添加 profile2 表单与 drupal 用户配置文件表单? 我试试这个钩子,但它对我不起作用:(

    function MY_MODULE_form_user_profile_form_alter(&$form, &$form_state) {
  if (($type = profile2_get_types('profile')) && $type->userCategory) {
    if (empty($form_state['profiles'])) {
      $profile = profile2_load_by_user($form['#user'], 'profile');
      if (empty($profile)) {
        $profile = profile_create(array('type' => 'profile', 'uid' => $form['#user']->uid));
      }
      $form_state['profiles'][$profile->type] = $profile;
    }
    profile2_attach_form($form, $form_state);
  }
}

【问题讨论】:

    标签: drupal drupal-7 profile


    【解决方案1】:

    https://drupal.org/project/account_profile zh_CN D7 版本可以做到。

    【讨论】:

      【解决方案2】:

      您是指编辑个人资料时还是您的用户在网站上注册时? 如果你的意思是以前,它不会!这是一个不同的实体,因此它始终在您的个人资料编辑页面上有一个选项卡。如果您有多个与您的帐户关联的个人资料,则每个个人资料都有一个单独的选项卡。如果您想完全避免这种情况,请使用管理员 > 配置页面上“帐户设置”上的“管理字段”页面。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-06-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多