Update Static page
A humble script that opens your webpage and sucks in parts of it and saves the HTML into a DTML Document. The id of the DTML Document will be the page name of the URL + Then, to use it in DTML for example you do this: <html> <dtml-if "_.has_key('index_html_static') and REQUEST.QUERYSTRING==''"> <dtml-var index_html_static> <dtml-else> <!--DYNAMIC-CONTENT--> <dtml-var expensive_resource_heavy_looper> <!--/DYNAMIC-CONTENT--> </dtml-if> </html> To create the static DTML Document, you first need to create an External Method Id: update_staticpage, modulename: update_staticpage, functionname: update_staticpage Here's how: context.update_staticpage(context.web.doc.index_html.absolute_url()) or: context.update_staticpage(context.web.doc.index_html.absolute_url(), container=context.somefolder) Alternativly in DTML: <dtml-call "update_staticpage(web.doc.index_html.absolute_url())"> This can be useful to not have to write a cronjob: This is a very untested and simple script. It's idea is simple and anybody is free to do whatever they want and need with it.
|
|
Available Releases
Version | Maturity | Platform | Released |
---|---|---|---|
0.0.1 | Development | 2001-08-31 04:33:03 | |
update_page.py (1 K) | All | ||
update_staticpage.py (2 K) | All |