Hi Bryon--
You can do this with a pretty simple doc callback. Callbacks let you
respond to particular events. In this case, the insertion of a comment
tag is the event you want to respond to. Put this code somewhere in your
init ACL file:
function insert_tag_after_callback(doc, tagname, oid, op) {
if (op==1) { return 0; }
if (tagname == "_comment") {
goto_oid(oid);
insert("[" . username() . "]: ");
}
}
doc_add_callback(0, "insert_tag_after", "insert_tag_after_callback");
Now, when someone inserts a comment, it will be prepended with their
username, something like this:
with the caret positioned so the user can start typing comment content
after the colon.
See the Help Center documentation for doc_add_callback for details on
how callbacks work and how to define callback functions.
--Clay
Clay Helberg
Senior Consultant
TerraXML
1380 Forest Park Circle, Suite 100
Lafayette, CO 80027