A big part of using open source products like Drupal is sharing. Through use and customization, a great product can become incredible. Drupal is an example of an open source product with a great design, current functionality, and huge user/developer base.
I'd like to share my first Drupal hack and hope this makes it's way into the larger Drupal community.
I'm using the popular recipe module for sharing and collaborating on recipes. I'm also using the taxonomy module for categorizing content. I noticed that when I visit the pages created by the taxonomy_menu module, recipes would not display correctly. The reason was that the taxonomy module treats recipes like regular nodes without adding the additional information stored in the recipe table.
To fix this, I had to make a slight change to the taxonomy_render_nodes() function in taxonomy.module. I changed
while ($node = db_fetch_object($result)) {
$output .= node_view(node_load(array('nid' => node->nid)), 1);
}
To
while ($node = db_fetch_object($result)) {
if ($node->type == "recipe")
{
$n = node_load(array('nid' => $node->nid));
$recipe = recipe_content(recipe_load($node));
$n->body = $recipe->body;
$output .= node_view($n);
}
else
{
$output .= node_view(node_load(array('nid' => node->nid)), 1);
}
}
Now recipes show up correctly in the pages created by the taxonomy module.