Timeline for What is the best practice for theming?
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 9, 2011 at 23:57 | comment | added | Adam S | I've used the example you have given. However, in Drupal 6 it was impossible to move comments around. Now comments can be placed any where in the $page array. The original question is what are the different possibilities like these and the best way to accomplish them? | |
May 9, 2011 at 22:06 | comment | added | Berdir | @Adam I'm not a themer, but regions defined in the .info file available as variables only for page.tpl.php according to drupal.org/node/171224. But yes, you can define a region and then manualy load the blocks of that region (example for D6 can be found here: zyxware.com/articles/1188/…). | |
May 9, 2011 at 21:21 | comment | added | Adam S | response to edit: Sure you can put regions inside of regions in Drupal 7. Take the example of an online newspaper article with a block that has similar content -- this block's context is created in a View. If I want this with the article text wrapping around it, the block, View, or region needs to be printed in the node template. Because drupal_render() is recursive concatenating and returning an HTML string at the end of every branch in the entire $page array, there is no reason not to leverage the Context module UI to manage these contextual blocks embedded in a node template. | |
May 9, 2011 at 20:57 | history | edited | Berdir | CC BY-SA 3.0 |
added 517 characters in body
|
May 9, 2011 at 20:51 | comment | added | Adam S | I understand the module development strategy to use '#theme' => 'table' rendered array instead of the old $output .= theme('table'). From a themer point of view where is the best place to hook into building of the page array to start moving comments into side blocks, regions inside of node templates....... oh, I just realized the answer. Use hook_page_alter(), hide the region with hide($region) and add it to the node array. Then add print render($region) in the node template file. I just wish there was a unified theory of moving stuff around. | |
May 9, 2011 at 19:57 | history | answered | Berdir | CC BY-SA 3.0 |