Forum OpenACS Q&A: Response to Templating System : Designer Guide : Tag Reference : Property

Hi Torben,

The "My Home Page" within the <property> tags has nothing to do with the "my home page" in the next line (thus, it's a confusing example if you don't know what is going on).

Here's a brief step-by-step (minor changes for clarity)...

Line 1:

<master src="my-master">
This says to the web server: I have a master template and it's called "my-master". Once you're done evaluating all the stuff on my page, go and evaluate everything in the my-master page. There you will find a <slave> tag. Stick all of the output from me into the space occupied by that slave tag. Then return that entire page to the user as the final page.

Line 2:

<property name="title">My Home Page</property>
This tells the web server: Go look in my-master for a variable called title (@title@). Set that variable to "My Home Page". So, the property tag is a way to communicate variables up to the master template. It doesn't affect anything on the rest of the ADP page being evaluated.

So, the following ADP page:


<master src="my-master">
<property name="title">OpenACS rules!</property>
<property name="help-link"><a href="blahblah">Help</a></property>

<p>Welcome!</p>

<p><b>i love templating</b></p>


with the following my-master.adp template:
<html>
<head><title>@title@</title></head>
<body>
<h2>@title@</h2>
<hr>
@help-link@

<slave>

<hr>
</body>
</html>

would create the following HTML document:
<html>
<head><title>OpenACS Rules!</title></head>
<body>
<h2>OpenACS Rules!</h2>
<hr>
<a href="blahblah">Help</a>

<p>Welcome!</p>

<p><b>i love templating</b></p>

<hr>
</body>
</html>

Hope that helps a bit...(and hope all the tags make it through to the bboard properly!)