OpenACS Edit This Page Templates
by Nick Carroll
OpenACS docs are written by the named authors, and may be edited
by OpenACS documentation staff.
-
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.
-
Exercise 1: Create a Subsite
Exercise 2: Checkout and Install edit-this-page (ETP)
Checkout ETP from CVS:
cd ~/openacs/packages
+
Exercise 1: Create a Subsite
Exercise 2: Checkout and Install edit-this-page (ETP)
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.
Exercise 4: Create a New ETP Template
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
+ 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.
Exercise 4: Create a New ETP Template
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:
Table 9.1. table showing ETP layout
Header |
Sidebar | Main Content Pane |
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.
Exercise 5: Register the col2 Template with 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
Restart your server for the changes to take effect.
Exercise 6: Configure ETP to use the col2 Template
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$)
View comments on this page at openacs.org
+ cp article-index.tcl col2-index.tcl
The template should provide us with the following ETP layout:
Table 9.1. table showing ETP layout
Header |
Sidebar | Main Content Pane |
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.