Forum OpenACS Q&A: Using an .adp template with a .vuh page
I'm trying to implement an archive page for my new weblog over at
http://www.pinds.com. I want you to be able to say
http://www.pinds.com/blog/archive/2002/02/ to get the archive for
all of February, or http://www.pinds.com/blog/archive/2002/02/27/ to
get the archive for today.
The obvious attempt would be to have an index.adp next to the
index.vuh, and simply say "ad_return_template" at the end of the
script, but it doesn't work: Nothing gets sent to the browser.
I've tried to look at the acs-templating code and see if I could
figure out some obvious way to do it, without any luck. So far I've
been unwilling to go through and try to decipher all of the code.
While I'm a big fan of the way the templating system generally
works, I'm not a big fan of the way it's implemented.
Any luck, anyone?
rp_serve_abstract_file [append path "my-template"]
# www/tmp/index.vuh set path [string trimright [ad_conn file] index.vuh] rp_serve_abstract_file [append path "virtual"] # www/tmp/virtual.tcl set urlv [ad_conn urlv] ad_return_template -- www/tmp/virtual.adp <master> <h1> @urlv@ </h1>The real work of serving the request is pushed off to the virtual.tcl/adp pair so that the template can be different than that used for index.tcl without breaking the convention that code/template pages are similarly named. My bad...
I can see that Stephen's solution will work for returning a .tcl/.adp page pair from the file system, but has anyone yet worked out how to include the contents of tcl vars in a page served from Edit-this-page - (or am I just getting too ambitious here!?).
rp_form_put x $x
Where my-template could refer to a single file my-template.adp, which would display the content of the variable x if it contains @x@.
I am not quite sure what you are asking though ..
i.e. ETP root mounted on /content and index.vuh in web root at / so that when http://www.bloggs.com is requested the request processor serves /content/index via the ETP application. So the page is an ETP served page from the database wrapped in defaultmaster.adp. My question is then how to I include variables from a .tcl script in the part of the page that was served by the ETP app?