packages/editthispage/templates
directory to get started, but here's an overview of what you need to know.
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.
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
attributes that correspond to it will be included.
The complete list of standard attributes in the pa array is as follows:
Once the pa
array variable has been created as a template
data source, the template itself may reference the values it contains using
the standard syntax for "onerow" data sources; for example, @pa.content@
.
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.
By making use of the procedure's switches you may modify the query results
it produces:
- -attributes [list] - list of additional page attributes to return (when required for display)
- -orderby [list] - list of columns on which to sort.
- -where [list] - list of SQL where clauses to restrict the query.
Each row in the result set always contains values for the following page attributes:
The content_items variable is created with a single db query, and currently is never cached.
luke@museatech.net |