Bye, bye region.tpl.php and block--system--main.tpl.php

English
  1. /**
  2.  * Implements hook_page_alter().
  3.  */
  4. function mytheme_page_alter(&$page) {
  5. // Remove all the region wrappers.
  6. foreach (element_children($page) as $key => $region) {
  7. if (!empty($page[$region]['#theme_wrappers'])) {
  8. $page[$region]['#theme_wrappers'] = array_diff($page[$region]['#theme_wrappers'], array('region'));
  9. }
  10. }
  11. // Remove the wrapper from the main content block.
  12. if (!empty($page['content']['system_main'])) {
  13. $page['content']['system_main']['#theme_wrappers'] = array_diff($page['content']['system_main']['#theme_wrappers'], array('block'));
  14. }
  15. }
Категория: 
The code has been tested and works

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Target Image