User: nicklewisatx Branch: HEAD Date: Fri, 13 Apr 2007 03:57:54 +0000 Added files: /sandbox/nicklewisatx/modules/elementapi default.regions.php Modified files: /sandbox/nicklewisatx/modules/elementapi elementapi.info elementapi.install elementapi.module Log message: Define page regions "branding", "content", and "footer" that can be overriden arbitrarily. Stake out elementapi_region_ namespace for module defined replacements. Add elementapi_callback_set to insert content into predefined regions, and elementapi_callback_hide to unset variables that would generate markup (if (empty('#value' ) { unset($element)}. Here's an example callback that uses this: <?php /** * Callback for node subpages */ function onn_network_sub_pages($node, $show, $category) { $elements = array(); switch($category) { case 'team': $body = $node->field_team[0]['value']; break; case 'talent': $body = $node->field_talent[0]['value']; break; } // hack attack... $content = _filter_autop($body); $elements['body'] = array('#value' => $content); $elements['back'] = array( '#type' => 'html', '#value'=> l('Back to Last Page', 'node/'.$node->nid), '#element' => 'p', '#weight' => 10 ); $sidebar['quicknav']['#value'] = drupal_get_form('onn_network_quicknav_form', NULL, NULL, NULL, TRUE); $main_content['info'] = $elements; return set_element_template(NULL, array( 'content' => array( 'set' => array( 'main-content' => $main_content, 'sidebar' => $sidebar, ), 'hide' => array('breadcrumb'), ) ) ); } ?> Its to be noted that you need to override the default phptemplate page to get any use out of this. Will be adding an example theme soon. Links: http://cvs.drupal.org/diff.php?path=contributions/sandbox/nicklewisatx/modul... http://cvs.drupal.org/diff.php?path=contributions/sandbox/nicklewisatx/modul... http://cvs.drupal.org/diff.php?path=contributions/sandbox/nicklewisatx/modul... http://cvs.drupal.org/diff.php?path=contributions/sandbox/nicklewisatx/modul...