需要Drupal模块帮助

时间:2015-03-04 10:58:07

标签: drupal-6 drupal-modules

function nat_customForms_block($op = 'list', $delta = 0, $edit = array()){
// set up an empty array which will contain the block contents
$block = array();

switch ($op) {
  case "list":
    drupal_set_message('<h1 style="color:orange;">>Medjool List </h1>');
    // Generate listing of blocks from this module, for the admin/block page
    $block[0]["info"] = t('Medjool Dates are scrummy don\'t you know');
    //$block[0]["content"] = "list # list # list # list # list # list # list # list";
    $block[0]["content"] = _nct_customForms_CONTENT();
  break;

  case "view":
    drupal_set_message('<h1 style="color:purple;">>Medjool View </h1>');
    // Generate listing of blocks from this module, for the admin/block page
    $block[0]["info"] = t('Medjool Dates are scrummy don\'t you know');
    $block[0]['status'] = 1;
    $block[0]["subject"] = 'SUBJECT Medjool SUBJECT';
    $block[0]["content"] = '####Medjool Dates are scrummy don\'t you know####';

case "save":
  break;

case "configure":
  break;
}
return $block;
//print render($block['content']);
}

使用Drupal 6我试图让这个块输出一些内容。当我将它分配给面板中的某个区域但没有呈现内容时,我可以看到它。如何在面板中呈现块的内容部分?

谢谢你!

1 个答案:

答案 0 :(得分:0)

在我从$ block

中删除delta部分后,上面的代码开始为我工作

例如

$block[0]["info"] = t('Medjool Dates are scrummy don\'t you know');

变成

$block["info"] = t('Medjool Dates are scrummy don\'t you know');

很奇怪,因为我将$ delta指定为0。

相关问题