List Info

Thread: Re: theme('table')




Re: theme('table')
user name
2007-04-21 23:18:22
Hi,

adrian rossouw wrote:
> 
> On 21 Apr 2007, at 8:41 PM, Moshe Weitzman wrote:
> 
>>
>> this sounds nice and consistent to me ... or we
expand drupal_render 
>> usage and expect folks to override #theme if they
want to take over 
>> themeing for a certain table. that seems like a
more long term 
>> project, with more a bit more uncertainty.
>>
> 
> doesn't that work today though ?
> just needing a documentation change.
> 
> ie: it always uses #theme if found, instead of the
theme_#type.
> 

Yes does work, but not very well. You can change the look of
your table, 
but that is about it.

What I would love to see if being able to add new columns to
a table, 
and then populate it will more information.

An example would be the comment list, where you could add an
additional 
column or row with hook_form_alter() and then it will get
themed the way 
that you want it.

Gordon.
> !DSPAM:1000,462aafca298781821219920!

Re: theme('table')
country flaguser name
United States
2007-04-22 07:48:13
Gordon Heydon wrote:
> Hi,
> 
> adrian rossouw wrote:
>>
>> On 21 Apr 2007, at 8:41 PM, Moshe Weitzman wrote:
>>
>>>
>>> this sounds nice and consistent to me ... or we
expand drupal_render 
>>> usage and expect folks to override #theme if
they want to take over 
>>> themeing for a certain table. that seems like a
more long term 
>>> project, with more a bit more uncertainty.
>>>
>>
>> doesn't that work today though ?
>> just needing a documentation change.

i think it does. so whats needed is some general agreement
that we should 
output tables not directly through theme('table') but rather
with a 
construct like:

$page['forum_overview'] = array(
   '#type' => 'table',
   '#header' => $header,
   '#rows' => $rows
)
$output = drupal_render($page);

the big advantage is that modules can alter a table as
suggested by Gordon 
and that themers can override a single table with #theme.
the disadvantage 
is a small performance dip. we'll do some benchmarking to
understand the amount.

note that i'm only talking about output of tables through
drupal_render(), 
not whole page.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )