Forum OpenACS Q&A: Turning on and off Comments on static pages

How does an admin control whether a particular static page can receive
comments or not.  We have gone through a vast amount of the online docs
and admin interfaces and find them completely lacking in controlling
this feature of the ACS.  We have looked through the general comments
module and static pages admin interface specifically.  Any help would
be appreciated.

Thanks.

Collapse
Posted by Dave Bauer on
You can set patterns for filters that specify which pages will not receive comments. Check out yourserver/admin/static This is the relevant part:
Index Exclusion You can exclude some or all of the static pages from the index by entering patterns that match the URL or page title of a static page.
You can exclude files by url_stub, or page_title. I exclude the admin and doc directories like this : /admin/% and /doc/%
Collapse
Posted by S. Y. on

There's a very old legacy tag that does this (or did). It's been a while since I ran the ACS, but it's still in ad-html.tcl on ACS 3.x.

    # this must stand for "do not disturb"
    # if you put it into a static .html file, the
    # following Tcl proc serves the page unmolested
    
    proc ad_dnd_tag {} {
        return "<!--AD_DND-->"
    }
    

I usually stick this right after the opening <HTML> tag.

Collapse
Posted by Cynthia Kiser on
Caveat - I do not run an OpenACS site. But if OpenACS is a fairly straight port of ACS 3.2 the following should apply. You can turn off comments on static pages by adding your directory or other glob pattern to ad_naked_html_patterns (defined in tcl/ad_html.tcl), or you can use the AD_DND tag posted above in the pages themselves, or you can sync your html files in the data base (/admin/static/static-syncer-ns-set.tcl), then go to the "all pages in ___" listing (on /admin/static/index.tcl), click on an individual link (/admin/static/page-summary.tcl?page_id=1), and toggle the comment properties individually.

Probably the fastest option is edit the glob patterns. The most flexible - assuming you want comment on some of you pages and not others - would be to use the sync script to find your files and insert their location into the database - then update the table manually to set up the initial sets of files that do and do not accept comments. Then use the admin interface to continue maintianing and fine tuning commentability.

If you never want comments, ever, how about unregistering ad_serve_html_page?

Collapse
Posted by Marcin Bajer on
In case you want to turn comments on static pages on and off via
the admin interface: go to the /admin/static/static-pages.tcl
page. There you will find list of all pages included in the index.
By clicking on a page link, you get a form where you can control
comments and links appearance on that page.
This is one of the most horrendous UI designs I've seen in a long time. Can we *please* fix this in OpenACS 4.x?