Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Print custom search blocks within content for D7. Use PHP filter and this works with no errors.
<?php
$block = block_load('custom_search_block','2');
$content = _block_get_renderable_array(_block_render_blocks(array($block)));
$output = drupal_render($content);
print $output;
?>
- custom_search_block is the module name
- 2 is the specific search block
Comments
Comment #2
crutch CreditAttribution: crutch commentedComment #3
fweiss CreditAttribution: fweiss commentedFYI in case this doesn't work for you...
Change "custom_search_block" to "custom_search_blocks"
Add "s",