Drupal Views - Custom Theme for a field

997 Views Asked by At

Two quick questions regarding custom theming of view fields in Drupal 6 -

(a) I know that we can include a custom theme for a view field in a appropriately named template file but I notice that it has to be placed in the theme folder.

However, I want this theme file to be bundled with my module and was wondering if it could be done somehow?

(b) Can we have a preprocess function to set custom variables before the field is themed?

1

There are 1 best solutions below

0
On BEST ANSWER

(a) I suspect it will be difficult because of the limitations of preprocess functions. Depending on what you need to do, you might be able to use the hook_views_pre_render function.

(b) Here are some tips on theming views with preprocess functions.