Forum OpenACS Q&A: Re: -query swith in ad_page_contract

Collapse
Posted by Jim Lynch on
(from Brian Fenton: Jim, can you give a simple example of how you use it)

Brian, sure.

So if you use ad_page_contract without it, then you need two parameters like this

ad_page_contract { docs go here } { variables coming into the page (aka the query) go here } and other switches go here

example of "and other switches", I might use -properties, like this:

ad_page_contract { docs } { incoming } -properties { outgoing }

I like to use it this way:

ad_page_contract { docs } -query { incoming vars }

or if I want to document the vars available to the .adp:

ad_page_contract { docs } -query { incoming } -properties { outgoing vars }

-Jim

Collapse
Posted by Brian Fenton on
Cheers Jim. I must start using the -properties more often. Good advice!
Collapse
Posted by Dave Bauer on
-properties sounds like a good idea :) Most modern openacs code doesn't use it as the common design pattern is for the ADP designer to be the same person as the Tcl programmer, in my experience.

Also there was some dreamed of feature to show the properties somehow in the documentation, that would be interesting.

Collapse
Posted by Brian Fenton on
"ADP designer to be the same person as the Tcl programmer"

AND the DBA, the sysadmin, the network guy plus office security 😉

Collapse
Posted by Steve Manning on
Wow you have someone else to make the tea? I'm jealous :)