Blocks always have a renderable element named content in them. Lets get rid of that, now that #theme_wrappers can be an array. This simplifies the $page structure so our interesting content is less buried.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

moshe weitzman’s picture

Status: Needs work » Needs review
FileSize
1.74 KB

Fixed a sloppy loop in filter admin form.

I am seeing errors now in html corrector tests with and without my patch. probably some local problem. anyway, bot will hopefully clear it up.

Gábor Hojtsy’s picture

How does this get rid of the content element?

Dries’s picture

I don't get this patch. I mean, I understand what it does and support what it does, but I don't understand how it aligns with removing the 'content' element as mentioned in the description. It feels like there is a bit of a disconnect between the patch and the explanation. Confused. Care to elaborate, Moshe? Thanks would be helpful. Thanks!

moshe weitzman’s picture

I don't mean that it gets rid of the content *region*. Thats at the top level of $page. I refer to a deeper elelement also named 'content'. This gets rid of that useless level of nesting for all blocks in the $page structure. Does that clarify?

webchick’s picture

Status: Needs review » Needs work

Can you update the code example in hook_page_alter() where they explain how to reference blocks? Maybe that'd help alleviate confusion in this patch.

moshe weitzman’s picture

Status: Needs work » Needs review
FileSize
27.64 KB
30.3 KB

good idea webchick. but i looked and everything it says there is still accurate after this patch. It doesn't mention each block's 'content' key. It is prescient :)

Here are screenshots which illustrate the change. Note that 'content' is gone in the 'after' one.

webchick’s picture

Status: Needs review » Fixed

Oh. Yay, us! :P

Committed to HEAD.

sun’s picture

The extra layer is not really useless IMHO. Consider administrative 'admin_links' that could be nicely stuffed into a sibling of 'content'.

moshe weitzman’s picture

why would that be any better than putting it alongside the block content like we do for nodes and comments?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.