by Nick Carroll
</authorblurb>The OpenACS templating system allows you to give your site a consistent look and feel. It also promotes code maintainability in the presentation layer, by allowing presentation components to be reused across multiple pages. If you need to change the layout for some reason, then you only need to make that change in one location, instead of across many files.
In this problem set you will familiarise yourself with the templating system in openacs. This will be achieved through customising an existing edit-this-page application template.
Before proceeding, it is strongly advised to read the templating documentation on your OpenACS installation (http://localhost:8000/doc/acs-templating). The documentation lists the special tags available for ADP files.
Create a subsite called pset3.
A subsite is simply a directory or subdirectory mounted at the end of your domain name. This can be done in one of two places:
http://localhost:8000/admin/site-map
or the subsite admin form on the main site, which is available when you login to your OpenACS installation.
Checkout ETP from CVS:
cd ~/openacs/packages cvs -d:pserver:anonymous@openacs.org:/cvsroot login cvs -d:pserver:anonymous@openacs.org:/cvsroot co edit-this-page
Go to the package manager at http://yoursite/acs-admin/apm. And install the new package: edit-this-page.
Or use the "Add Application" form available on the Main site.
Work out how to change the ETP application.
Investigate each of the available ETP templates:
Default
News
FAQ
Browse the files for each of the above ETP templates at:
cd ~/openacs/packages/edit-this-page/templates
Use the article template as the basis of our new col2 template.
cp article-content.adp col2-content.adp cp article-content.tcl col2-content.tcl cp article-index.adp col2-index.adp cp article-index.tcl col2-index.tcl
The template should provide us with the following ETP layout:
The "Main Content" pane should contain the editable content that ETP provides.
The "Header" should display the title of the page that you set in ETP.
The "Sidebar" should display the extlinks that you add as a content item in ETP.
Need to register your template with ETP so that it appears in the drop-down menu that you would have seen in Exercise 3.
cd ~/openacs/packages/edit-this-page/tcl emacs etp-custom-init.tcl
Use the function etp::define_application to register your template with ETP
Uncomment the "asc" definition
Set allow_extlinks to true, the rest should be false.
Restart your server for the changes to take effect.
Configure your ETP instance at /lab4/index to use the col2 template.
Create external links to link to other mounted ETP instances.
Check that your external links show up in the sidebar when you view your ETP application using the col2 template.
This problem set was originally written by Nick Carroll in August 2004 for the University of Sydney Course EBUS5002.
This material is copyright 2004 by Nick Carroll. It may be copied, reused, and modified, provided credit is given to the original author.
($Id: tutorial-etp-templates.html,v 1.11 2017/11/08 09:42:12 gustafn Exp $)