Forum OpenACS Development: Re: ad_page_contract to be used on includes

Collapse
Posted by Tom Jackson on

Here is an example of a wrapper:

parent.adp:

<include src="wrapped-child" var="val" >

child.tcl

ad_page_contract { I handle query vars } {var:notnull} 

ad_return_template

child.adp:

<include src="wrapped-child" var="@var@" >

otherpage.adp:

<include src="wrapped-child" var="@var@" >


wrapped-child.tcl:

ad_page_contract { This is my include file, no query vars.} 

ad_return_template

wrapped-child.adp:

my var is @var@

You can use ad_page_contract on the include file, and you can possibly copy and paste the include tag to other templates when needed.