【问题标题】:Drupal Module help required需要 Drupal 模块帮助
【发布时间】:2015-03-04 10:58:07
【问题描述】:
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 我试图让这个块输出一些内容。当我将它分配给面板中的一个区域但没有呈现任何内容时,我可以看到它。如何使块的内容部分在面板中呈现?

谢谢!

【问题讨论】:

    标签: drupal-6 drupal-modules


    【解决方案1】:

    在我从 $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。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-03
      • 2011-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多