A lot of my additions reuse the same functions, I should probably separate the CCK hooks from all of the functions, so that code doesn't get repeated. Is this the right way to go about this? If so what should I call the module that holds all the functions?

Comments

Crell’s picture

Depends on the details of what you're doing. If the modules will all live in the same directory you can have a common include file that they all call module_load_include() on, which will automatically keep it from getting called multiple times. Unless it's a lot of code, though, it's probably not worth it. CCK formatters tend to have a lot of boilerplate code that's not worth trying to factor out. C'est la vie.

deciphered’s picture

Custom Formatters is pretty much based around this issue, it itself is just a shell for the CCK formatter hooks, whereas the formatters code is kept in the database.

Crell’s picture

Um, what? Keeping code in the database is a generally bad idea. It's slower, harder to debug, and arguably a security risk. And since this module exists, er, why create another one?

deciphered’s picture

@Crell

Custom Formatters isn't another version of CCK formatters, it is a utility to create custom CCK formatters oppose to a collection of pre-made custom formatters. Therefore the database is the only place you could keep the data of the formatters.

Crell’s picture

Issue summary: View changes
Status: Active » Closed (outdated)