Index: openacs-4/packages/edit-this-page/www/doc/templates.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/doc/templates.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/edit-this-page/www/doc/templates.html 9 Jan 2003 20:23:10 -0000 1.1 +++ openacs-4/packages/edit-this-page/www/doc/templates.html 9 Jan 2003 21:13:33 -0000 1.2 @@ -1,52 +1,31 @@ Templates -
-
This is G o o g l e's cache of http://etp.museatech.net/etpdoc/templates.
-G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
-The page may have changed since that time. Click here for the current page without highlighting.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:kaDJjn1RdBYC:etp.museatech.net/etpdoc/templates+etp+documentation+site:etp.museatech.net&hl=en&ie=UTF-8


Google is not affiliated with the authors of this page nor responsible for its content.
-
These search terms have been highlighted:�etp�documentation�
-
-
- + +

ETP Templates

- - - - - -A Musea Technologies Project - - -

Templates

- - -Edit This Page Demonstration : ETP Documentation : Templates - -
+ETP Documentation:ETP Templates
- - -To use ETP, or in fact to effectively use OpenACS 4, it's essential that you become familiar with the ArsDigita Templating System. ETP's +To use ETP, or in fact to effectively use OpenACS 4, it's essential that you become familiar with the OpenACS Templating System. ETP's support for rapid application development includes procedures for creating the data sources that will be used by your page templates. You can copy code from the examples in the packages/editthispage/templates directory to get started, but here's an overview of what you need to know.

Providing the "Edit this page" link

-As demonstrated in packages/editthispage/www/master.tcl, you should call the procedure etp::get_etp_link +As demonstrated in packages/editthispage/www/master.tcl, you should call the procedure etp::get_etp_link from your own master template, in order to determine whether or not to present the user with the "Edit this page" option. The procedure returns the html -link only within an instance of the ETP package, and then only if the user has write access. Otherwise an empty string is returned. +link only within an instance of the ETP package, and then only if the user has write access. Otherwise an empty string is returned.

Retrieving page attributes for the template to display

-Every ETP template will make use of the etp::get_page_attributes procedure. It creates an array variable called pa in the caller's stack frame, +Every ETP template will make use of the etp::get_page_attributes procedure. It creates an array variable called pa in the caller's stack frame, containing all the attributes necessary to render the current page. These attributes include the standard elements from the cr_revisions table such as title, description, and content. If the page is using -a custom content type, any extended page +a custom content type, any extended page attributes that correspond to it will be included.

The complete list of standard attributes in the pa array is as follows: @@ -59,7 +38,7 @@

  • description
  • publish_date
  • content -
  • extended attributes, if any, defined by etp::make_content_type +
  • extended attributes, if any, defined by etp::make_content_type
  • The procedure is designed to be efficient under heavy load. The database is accessed once to retrieve the attributes, and a second time to generate @@ -70,7 +49,7 @@ the standard syntax for "onerow" data sources; for example, @pa.content@.

    Retrieving the list of pages in a content section

    -ETP templates used for the index page will almost always make use of the etp::get_content_items procedure. It creates a variable called content_items +ETP templates used for the index page will almost always make use of the etp::get_content_items procedure. It creates a variable called content_items in the caller's stack frame. This is a multirow result set suitable for passing to an index template, containing all the structured data necessary to present a list of links to content pages, folders, extlinks, or symlinks. @@ -96,7 +75,7 @@ Additionally, you may name additional attributes that will be returned, either from the standard page attributes stored in cr_revisions, or extended page attributes defined with - etp::make_content_type. + etp::make_content_type.

    The content_items variable is created with a single db query, and currently is never cached.