Hello everyone, i have some question. Is there any way to customize and theming table in buddylist.module.
If yes, how can i do this?
If no, why?

Comments

jwilde’s picture

Hi,

No limitations here - you have the source code - do whatever you feel like. Also, check out the php theme and page snippets. Use search to find them.

Jim

nickie’s picture

Yeah, of course, you are right, but if i patch this module in code i would be unable to upgrade.
So my question is how to do theming without patching the module.

Is there way to do it through template.php and new template for buddylist?

dldege’s picture

Override theme_table()

is the first and easiest place to change the buddylist table. When theme('table') is called from buddylist each row contains the account object for the buddy so you should be able to show any information. If you want to return something other then a table that would be ok too but be sure you only do this for buddylist tables since changing theme_table would otherwise effect all tables.

There is a discussion in the buddylist project to improve the theme support http://drupal.org/node/105446. I also made a small change to the code that lets me add custom headers and columns to the table before the call to theme('table');

dLd