I want to provide this option that users be able to put comment on each paragraph of an article that a user has posted in Drupal.
I have applied some changes to node.tpl.php file, like
$paragraphs = explode("<p>",render($content));
so I can render each paragraph with a for loop, like:
$number=count($paragraphs);
for ($i=1;$i<$number;$i++)
print render($paragraphs[$i]);
Now, I want to write a module to provide the commenting option for each paragraph. I will use hook_node_view function to define a new field like:
$node->content['paragraphcomment']
which is similar to
$node->content['comments']
but the new one I am defining is a 2 dimensional array. so after
print render($paragraphs[$i]); // in node.tpl.php
I can write
print render($content['paragraphcommnet'].
But I need to know in which file $node->content['comments']
is defined. If anybody can help me with I would really appreciate it. Also if you think my solution is wrong, please let me know.
Thank you