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;
}
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.