James Thornton logo
James Thornton
Google
Web jamesthornton.com
Internet Business Consultant
Home Blog Bio Projects Contact
JamesThornton.com -\> ACS -\> OpenACS comments on ADP pages

HOWTO: OpenACS comments on ADP pages

Here is a solution for including comments on ADP pages, and it also handles the abstract_url issue:

  1. set your nsd.tcl file to parse .html pages as ADP pages.

  2. modify ad_serve_html_page (in ad-html.tcl):
            #set stream [open $full_filename r]
            #set whole_page [read $stream]
            #close $stream
    
            set whole_page [ns_adp_parse -file $full_filename]
    
    Note: My ad_serve_html_page proc serves up a custom header and footer (no need for ad_header or ad_footer) -- titles and meta data are coded in the html/adp page.

  3. Save/convert your .adp files to .html -- here is a script that does this:
    #!/bin/sh
    # copies .adp files to .html
    for file in *.adp ; do
            cp $file ${file%.adp}.html
    done
    
  4. sync your database

    If you already serve up a custom header and footer with ad_serve_html_page, then you will probably get doubles for adp pages that use ad_header and ad_footer. I had this working without modifying nsd.tcl to parse .html files as ADPs, but it did not work with abstract URLs (abstract URLs worked fine for HTML pages).


Follow espeed on Twitter