I'm trying to create a Drupal custom module that would enclose any page or article content with specific microdata tags (among other things). I've successfully inserted code in both the header and before the closing '' tag, but when I try to enclose the page content it just jams everything together at the end of the content.
For example, here's the module code:
function my_module_page_build(&$page) {
// add manifest value to header
$manifest_code = "..."
$page['header']['manifest'] = array(
"#weight" => 0,
"#markup" => t($manifest_code)
);
// add opening microdata tags
$opening_microdata = "...";
$page['content']['my_module_open_microdata'] = array(
"#weight" => 0,
"#markup" => t($opening_microdata)
);
$closing_microdata = "...";
$page['content']['my_module_close_microdata'] = array(
"#weight" => 25,
"#markup" => t($closing_microdata)
);
// add javascript to footer
$javascript = "...";
$page['page_bottom']['my_module_javascript'] = array(
"#weight" => 0,
"#markup" => t($javascript)
);
}
I don't want to insert the closing microdata into the $page['page-bottom'] slot because I don't want some of these links and other code inside the microdata tags. I've also tried using a negative weight to move it up, but no luck.
I've tried searching for more information on Node or Blog or Article structure to see if there are other slots for the code, but I can't find anything.
I'm sure this is very easy -- are there resources I'm missing for understanding page structure? Some simple solution I'm missing?