I have found another way of doing this. It was initially posted by Joel Aufrecht for the notes packages (
https://openacs.org/forums/message-view?message_id=82750), but can be easily modified for any package. This is the edit-this-page version:
for tcl:
set comment_add_url "[general_comments_package_url]comment-add?[export_vars {
{ object_id $pa(item_id }
{ object_name $pa(title) }
{ return_url "[ad_conn url]?[ad_conn query]"}
}]"
set comments_html [general_comments_get_comments -print_content_p 1 $pa(item_id)]
the adp should not stay the same whatever the package:
<a href="@comment_add_url@">Add a comment</a>
<p>@comments_html@