1

I want to make a few changes in the HTML output by the guestbook module. For example, I want to enclose the submitters name in a <div> or a <span> (so I can style it better).

What's the best way to do this? The only option I can think of is to modify the guestbook.module, but that could cause issues down the track.

2 Answers 2

4

Changing module code is usually a bad idea because it makes it hard to impossible to update to a newer version of the module.

Without knowing the structure of that module, changing the HTML/output should always be possible by overriding theme functions, which you can do without changing the original code.

See: http://drupal.org/node/11811

1

Modifing core or contrib modules is something you should avoid. It will cause problems or at least tedious additional work when you want to update.

If the module does not offer any possibilities to theme the output to your needs I'd sugest to add a feature request in the modules issue queue (check whether it does not already exist). Then go and make the output themeable and add your changes as patch.

This involves getting familiar with drupal theming for module developers and the drupal contrib developement process which could take some hours. But you'll win in the long run. If you're patch is accepted the feature will be part of the module this free's you from maintaining and mergin in your changes for every update.

Not the answer you're looking for? Browse other questions tagged or ask your own question.