2010-02-22 Poor-ly structured Drupal site ever seen

Drupal template system is so flexible that you can do anything in node.tpl.php

This let chaos happens in a site i maintain, which made my pull my hair out of my head. (sort of)

That is a classic example that more power bring a larger disaster.
The developer that leaves the project even define a form , its hook_validate() and its hook_submit() inside the node.tpl.php. TOTALLY INSANE.

As a professional developer, not a part time one, YOU SHOULD TAKE RESPONSIBILITY TO YOUR CODE!!
so, you should:

  • avoid any node_load() in *.tpl.php (should be in custom module or preprocess function)
  • avoid any complex PHP code in custom block content, and visibility settings. Build a custom module will only cost you 5 mins
  • multi site settings should be carefully planned
  • DOCUMENTATION on your magic tricks
  • 山寨就是貌似做到一樣, 但細緻就不行了

God bless me, please open new projects instead of fixing old ones.

Google