我想在Drupal 7加几节到用户配置文件下:如何将内容添加到Drupal 7中的用户个人资料页面?
<div class="profile" typeof="sioc:UserAccount" about="/drupal/user/1">
我加入三个新的章节,但问题是,虽然我使用相同添加三个部分的方法,其中只有一个被渲染为上面的div的子元素,而另外两个渲染为兄弟元素。我究竟做错了什么?
这是我如何创建内容:
function plan_user_user_view($account) {
//Create the markup for the events region
$account->content['events'] = array(
'#type' => 'user_profile_item',
'#theme' => 'events',
'#events' => $events);
//Create the region for the venues
$account->content['venues'] = array(
'#type' => 'user_profile_item',
'#theme' =>'venues',
'#userid' => $user->uid,
'#venues' => $venues);
//Create the region for creating an event
$account->content['creator'] = array(
'#prefix' => '<div class="user-event-item" id="quick-event-creator">',
'#suffix' => '</div>',
'#type' => 'user_profile_item',
'#title' => t('QUICK EVENT CREATOR'),
'#markup' => drupal_render(drupal_get_form('event_creation')));
}
此外,有没有更好的方法来创建最后一块的内容呢?其他两个在模板文件中看起来不错,但是最后一个是因为它是一个表单,我想知道是否有更好的方法来做到这一点。
感谢,