Forum OpenACS Q&A: Re: General-Comments with Edit-This-Page?

Collapse
Posted by Yves Goldberg on
I wasn't successful at applying the above code to add comments to ETP pages.

Anyone can confirm it still the way to go with 5.0 final?

Thanks.
Yves.

Collapse
Posted by Orzenil Silva Junior on
Hello Yves

I don't know if you are still interested about your question but I went into add comment link to edit-this-page - OACS 5.1 - and the code provided still works with minor changes.

1. Just put into /packages/edit-this-page/tcl/etp-gc-procs.tcl

namespace eval etp {

ad_proc -public get_gc_link { } {
  Called from rotisserie questions template to present      comment link
    taking out permission checking for now
    @author Pat Colgan mailto:pat@museatech.net
    @creation-date 4-17-01

} {
    upvar pa pa
    upvar comment_link comment_link
    set item_id $pa(item_id)
    set object_name [etp::get_name]
    set comment_link ""

    append comment_link "<center>[general_comments_create_link -object_name $object_name $item_id ]</center>"
    append comment_link "[general_comments_get_comments -print_content_p 1 $item_id ]"
    return "$comment_link"
  }
}

Important: watch this file in /acs-admin/apm

2. Put into your news-content.tcl

etp::get_page_attributes
etp::get_gc_link

3. Put into your news-content.adp

<if @comment_link@ not nil>
@comment_link;noquote@
</if>

/Orzenil