Theming: where to place custom function?

tyswan - May 8, 2008 - 03:52

Hello,

I want to truncate some of the output, to prevent users putting too much text into a Flexinode field (yes I will convert to CCK at some stage).

I found a function to truncate the text. I can't put it in the Felxinodex.tpl.php, because of node listings.

I tried putting it in template.php, but it broke my site (I couldn't create nodes correctly).

My question is:
1. Which file should I put the code in?
2. How should I insert the code? At the end?
3. Does it have to have a special naming convention?

e.g.
function phptemplate_theme_truncate
or
function myTheme_truncate

Thanks for your help.

Cheers,

 
 

Drupal is a registered trademark of Dries Buytaert.