php - How do I programmatically build, theme and display a Drupal block? -
php - How do I programmatically build, theme and display a Drupal block? -
i want output built in drupal "search" block within of "primary links" menu, built theme function framework_primary_links() within template.php. menu should end looking stackoverflow menu: [chat | meta | | faq | __search__], "search" field within menu <ul> itself.
so i'm not printing search block within part normal.
currently i'm doing:
$search_block = (object) module_invoke('search', 'block', 'view', 0); $output .= '<li id="searchcontainer">' . theme('block', $search_block) . '</li>';
but drupal applying "block.tpl.php" template , not "block-search.tpl.php" template want to.
how drupal apply "block-search.tpl.php" template file programmatically rendered block?
doing drupal_get_form('search_block_form')
homecoming markup core search form, , it'll have gone through search block form template alter code to:
<?php $output .= '<li id="searchcontainer">' . drupal_get_form('search_block_form') . '</li>';
php drupal drupal-6
Comments
Post a Comment