doushuhuai7247 2011-07-25 11:02
浏览 23
已采纳

怎么在Drupal 6中安排Block?

I am a newbie in Drupal, I just created a module and try to display. But the block HTML code breaks all boundaries of the Theme. How we can control the HTML in blocks ?

For example my block code is

function node_example_block($op='list',$delta=0){

    switch($op){
        case "list":
            $block[0]['info'] = t('THIS IS EXAMPLE NODE EXAMPLE ');
            return $block;
        case "view":    
            $block['subject'] = "THIS MY FIRST SAMPLE BLOCK";
            $block['content'] = get_tree_data();

            return $block;
    }
}

function get_tree_data(){

    /*
     $output = HTML CODES HERE .....
    */
     }

return $output;
}
  • 写回答

2条回答 默认 最新

  • du131642 2011-07-25 14:47
    关注

    I am not sure what you mean by "breaks all boundaries of the theme". If that means that your theme goes wrong when you use that block, then the answer is simply that your HTML is wrong - it may contain unclosed HTML tags for instance.

    The only answer to that is to fix your HTML. You may want to use Drupal's HTML corrector to see if that is indeed the problem :

    function get_tree_data() {
      /* fill $output */      
      return filter_filter('process', 3, -1, $output); /* Call htmlcorrector filter */
    }
    

    But I wouldn't recomend keeping it this way, as having a bug in your HTML could merely be a symptom of a bigger bug which you should fix.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作