[development] Table hook idea

Gordon Heydon gordon at heydon.com.au
Thu Nov 8 03:33:06 UTC 2007


#pre_render or form_alter will allow you to change the table anyway you

I am also wanting to create a contrib module which will allow you to do
this on Drupal 6 so I can make sure of this functionality in e-Commerce v5


Moshe Weitzman wrote:
> Thats great stuff, Gordon. Lets definately get this in early during D7
> so we can use it everywhere ... #pre_render is the mechanism for
> modules to add columns? seems reasonable to me.
> On 11/7/07, Gordon Heydon <gordon at heydon.com.au> wrote:
>> Hi,
>> Once drupal 6 is out I am going to be continuing my development of
>> merging theme(table) to the formapi. I have gotten the #pre_render into
>> the formapi so that we can generate the table from a drupal_render().
>> This means that the rendering of tables is moved into the form creation
>> which will simplify a lot of the admin pages in that they will not need
>> a theme() to create the page.
>> In e-Commerce I have a few use cases where I would like to be able to
>> alter the output of tables to include additional rows and columns, as
>> well as extending the information in cells.
>> One requested item is to be able to add shipping messages to
>> transactions. This is easy enough, but then getting this information out
>> is quite hard in that besides the invoice display, there is no where
>> without altering core ec code to add it. With this I can add an
>> additional row and display the message on the transaction search page.
>> Here is my proof of concept.
>> http://cvs.drupal.org/viewvc.py/drupal/contributions/sandbox/gordon/table_test/
>> It is written for Drupal 5, which is how I worked out that I needed the
>> #pre_render to be able to build a table.
>> Gordon.
>> Sean Robertson wrote:
>>> Got any examples of specific use cases?
>>> Mike Cantelon wrote:
>>>> Is there any interest in adding hook support to table rows and cells to
>>>> allow on-the-fly modification of table data by modules? Something like
>>>> "table_alter($headers, $rows)" and/or "row_alter" and "cell_alter".
>>>> Seems to me this would be easy to do by adding support for an "id" key
>>>> for tables, rows, and/or cells so if the id is set the hook is invoked
>>>> in other modules.
>>>> Cheers,
>>>> Mike
> !DSPAM:1000,473273dc242372016019361!

More information about the development mailing list