I have been exploring how to add content to database driven dynamic pages. This has been questioned recently, but there doesn't really seem to have been an answer:
http://drupal.org/node/204801
My site is a taxonomy (real taxonomy!) site which stores information on species in the database, where each species has a unique "species_id". The problem is when you add a comment to a dynamic page it adds it to the master page, and not the content. For example I have a page called taxonhandle which loads species specific content from the database depending what was selected. If you comment on any species, then the comment appears on all species because the comment is linked to the taxonhandle node, not the content (obviously).
Looking at the comment.module code it looks like it should be possible to include a function to add an additional identifier to the database table and the code. So when you comment on a dynamic page it adds the species_id to that comment row, or if no species_id is present it adds 0 (???) as I suspect an empty cell would upset the sql queries. And then when displaying comments it checks for the presence of a species_id variable on the page and calls relevant comments.
Sadly my sql isn't good enough and I just ended up breaking it. Is there anyone more competent who could lend a hand?
Matt