By Andargor on
Hi,
I've searched for a while and couldn't find a definite answer. So I apologize if I am blind and there's and answer somewhere.
I'm writing a module that returns dynamically generated pages (e.g. like the module tutorial shows on this page: http://drupal.org/node/82968 )
However, I would like to have an "add comments" link at the bottom of the generated pages. Is this possible without installing a bunch of other modules or creating arcane content types?
I've looked at hook_link, hook_view and hook_nodeapi, but they don't get called if it's not a node.
I'm looking for a simple solution, or some alternatives.
Thanks.
Comments
Just thought of something
Just thought of something else: if it's possible to attach a comment to a URL instead of a node, would that be feasible somehow? The generated pages could have unique URLs.
Links on dynamically generated page
This does not help in your problem, but...
I'm a drupal-newbie and I was also just pondering what is the proper way of displaying links on dynamically generated page since the hook_link() is only for nodes.
I ended up using theme_links():
It is very unfortunate, if comments can be attached only to nodes and other comments. I was planning to enable commenting on every page of my site, but it seems impossible.
I have a similar problem. My
I have a similar problem. My dynamic pages all have unique species_id's so it should be possible to insert the species_id (or similar unique identifier) into the comments tables in the database. Then recall comments according to node id and species_id (or your unique identifier). I had a look at the comments.module but ended up breaking it :)
Has there been any progress on this?
More of my predicament here:
http://drupal.org/node/212979
Here's what I tried
This is what I tried. It didn't work, but it didn't break it, so I obviously missed something, or more likely, several things. Maybe it's a helpful starter for someone. Numbers are line numbers, and my changes are the bits where $species_id appears. Like I said, I've obviously missed out loads, but I don't know where, and it still works at least!
I added a species_id column to the comments table, made a comment on the right node, and then went in to the database and manually assigned it a species_id. So at least there's something there for it to display if I ever get it working!
Then at the beginning somewhere I added this mess just to be certain it was being defined: