<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>ETP applications</title>
</head>
<body bgcolor="white"><h2>ETP Applications</h2>

<br clear="right">
<a href="./">ETP Documentation</a>:ETP Applications
<hr>

<h3>What is an ETP Application?</h3>

After you've created a package instance of ETP,
you've got a virtual directory on your website where you can create and edit
pages, links, or subdirectories.  The pages you create have a very plain
appearance and behavior: the index page displays a list of the other pages,
and the other pages simply display whatever content you enter for them. 
This behavior is governed by what's known as the "default application".<p>
The default application is defined by the ETP package at server startup time as follows:
</p><blockquote><pre>etp::define_application default {
    index_template               packages/editthispage/templates/article-index
    index_content_type           content_revision
    index_object_name           "subtopic"
    index_title_attr_name       "Title"
    index_description_attr_name "Description"
    index_content_attr_name     "Content"

    content_template             packages/editthispage/templates/article-content
    content_content_type         content_revision
    content_object_name         "page"
    content_title_attr_name       "Title"
    content_description_attr_name "Description"
    content_content_attr_name     "Content"

    allow_subtopics       t
    allow_extlinks        t
    allow_symlinks        t

    auto_page_name        ""
}
</pre></blockquote>You may customize the default application, or create new
applications based on it, thereby changing the appearance and content of
your web pages.<p>
</p><h3>Modifying the default application</h3>
It's a good bet that you'll want to alter the appearance of the pages generated by ETP.
 I highly recommend designing a master template for your site, and ensuring
that all packages you've installed are using it.  (If you don't know what
a master template is, the <a href="http://etp.museatech.net/doc/acs-templating/tagref/">ACS Templating Reference</a> will tell you).  First, make a copy of the templates you want from ETP:
<blockquote><pre>cd /web/MYSERVER/www
mkdir templates
cp ../packages/editthispage/www/templates/* templates
</pre></blockquote>
Now you can change the <code></code> tag at the top of <code>article-index.adp</code> and <code>article-content.adp</code> to refer to your master template.  Next, create a file in the MYSERVER/tcl directory, and add the following code:
<blockquote><pre>etp::modify_application default {
    index_template        www/templates/article-index
    content_template      www/templates/article-content
}    
</pre></blockquote>
After restarting your server, every instance of ETP that's using the "default" application will be rendered using your master template.

<h3>Creating new applications</h3>
When you edit a content section in ETP, you'll see a link that says "Choose ETP
Application".  At first this list contains just a few entries: default, faq,
news, and whatever other example applications were included with the ETP package.  You can add your own entries to the list by calling the <code>etp_define_application</code>
procedure.  The real power of defining new applications is that you can create
templates that reference structured data that is stored for each page in
the content repository, and ETP gives you the means to edit and organize the structured data.  To learn about how that works, please go on to read about <a href="contenttypes">Content Types</a>.

</span>

<hr>
<table width="100%">
<tbody><tr>
<td><address><a href="mailto:luke@museatech.net">luke@museatech.net</a></address></td>

</tr>
</tbody></table>

</body></html>