Forum OpenACS Q&A: Response to Using different calls in .adp files

Collapse
Posted by James Thornton on
I have a solution for including comments on ADP's 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

    I have this working at http://james.jamesthornton.com:8888 (let me know if it doesn't work -- I may have missed a step).

    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).