Issue status update for http://drupal.org/node/29145 Post a follow up: http://drupal.org/project/comments/add/29145 Project: Drupal Version: cvs Component: user.module Category: feature requests Priority: minor Assigned to: Tobias Maier Reported by: legoscia Updated by: Jose A Reyero Status: patch (code needs review) I dont think themeing individual blocks is a good solution. I'd rather have an ad hock module for providing specific alternate blocks or use CSS for now. And I'd like to point out that blocks are nearly themeable. I mean we have the theme_block function, which provides separated 'module', 'delta', 'title' and 'content' parameters. The only big problem is that content is plain HTML, very difficult to deal with if you want specific parts remoded. So, my proposed solution would be to have that $block->content become an array, with named keys. I.e. $block->content['user list'], $block->content['user count'], etc... Then, any theme_block function that wants to deal with specific blocks can handle individual elements. And in any other case -which should be the default-, we just do $output .= is_array($block->content) ? implode('', $block->content) : $block->content; Then you can start proposing additional patches to split specific blocks' content in elements. But old blocks would still work!! Hey, this is nearly a patch :-) Jose A Reyero Previous comments: ------------------------------------------------------------------------ Thu, 18 Aug 2005 20:10:06 +0000 : legoscia Attachment: http://drupal.org/files/issues/drupal-user-count.patch (3.4 KB) The normal look of the user block was too big for my site, and the count of online users was not deemed important enough. Thus here is a patch that makes the display of the user count optional, leaving only the list of online users. ------------------------------------------------------------------------ Thu, 18 Aug 2005 20:12:16 +0000 : moshe weitzman id prefer that this be hidden using theme's CSS. if you need a div added to the markup, then submit another patch ------------------------------------------------------------------------ Thu, 18 Aug 2005 23:30:25 +0000 : Uwe Hermann +1 for the idea. I wouldn't force users to manually fiddle with CSS files here. IMHO a config option is the better solution. ------------------------------------------------------------------------ Fri, 19 Aug 2005 08:43:22 +0000 : killes@www.drop.org I think the right answer is not yet another rarely used option, but to make the block's output themable. ------------------------------------------------------------------------ Wed, 31 Aug 2005 01:24:00 +0000 : Tobias Maier I think killes idea is the best :) ------------------------------------------------------------------------ Wed, 31 Aug 2005 08:34:15 +0000 : Tobias Maier Here is a patch which makes the following blocks themeable: - User login - Who's online I hope you like it ------------------------------------------------------------------------ Wed, 31 Aug 2005 08:34:44 +0000 : Tobias Maier Attachment: http://drupal.org/files/issues/issue29145_user.module.patch (5.27 KB) forgot the patch... ------------------------------------------------------------------------ Wed, 31 Aug 2005 08:35:51 +0000 : Tobias Maier *grrr* ------------------------------------------------------------------------ Thu, 01 Sep 2005 19:46:15 +0000 : Tobias Maier Attachment: http://drupal.org/files/issues/issue29145_user.module_0.patch (6.77 KB) here is a new version of the patch. all blocks are themeable now. please review it and tell me if it is ok. cu tobias ------------------------------------------------------------------------ Sat, 03 Sep 2005 10:35:28 +0000 : Tobias Maier Attachment: http://drupal.org/files/issues/issue29145_user.module_1.patch (6.75 KB) I changed one line... ------------------------------------------------------------------------ Sat, 03 Sep 2005 13:05:54 +0000 : Bèr Kessels +1. Until the dat ewe run any block trough a theme function by default, this is a great addition. So far I managed to tweak the login block woth locales and CSS, btu this would really help a lot. Especially now that we have multiple regions, blocks will want to appear different. It also cleans up some 'ugly' coding (huge functions). by moving the code into smaller functions.