From 5c4e5e4cc095e706dd694a20b3f9396ae9740ba5 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 22 Aug 2002 00:14:34 +0000 Subject: [PATCH] more tweaks git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@983 57a73879-2fb5-44c3-a270-3262357dd7e2 --- doc/templating.txt | 55 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/doc/templating.txt b/doc/templating.txt index 6386c37..e24b4f2 100644 --- a/doc/templating.txt +++ b/doc/templating.txt @@ -2,7 +2,7 @@ HTML Templating Mechanisms ========================== -:Version: $Revision: 1.9 $ +:Version: $Revision: 1.10 $ Current Situation and Issues ============================ @@ -197,6 +197,10 @@ Accesses through a class (either through *class* or *db.*): ''' return an HTMLItem instance ''' def classhelp(self, ...) def list(self, ...) + def filter(self): + ''' Return a list of items from this class, filtered and sorted + by the current requested filterspec/filter/sort/group args + ''' Accesses through an *item*:: @@ -280,24 +284,43 @@ Multilink HTMLProperty def __init__(self, ...) def filterspec(self, ...) -Action -====== +Template files +~~~~~~~~~~~~~~ + +Each instance will have the opportunity to supply the following templates: + +page + This is the overall page look template, and includes at some point a TAL + command that includes the variable "content". This variable causes the actual + page content to be generated. + +*.index + Displays a list of items from the database, and a "filter refinement" form. + Would perform a TAL ``repeat`` command using the list supplied by + ``class/filter``. This deviates from the current situation in that currently + the index template specifies a single row, and the filter part is + automatically generated. + +*.item + Displays a single item from the database using the *classname* variable (that + is, the variable of the same name as the class being displayed. If + +*.filter + Displays a full search form for a class. -1. Investigate how PageTemplates would be integrated into Roundup: +Note that the newitem template doesn't really apply any more because the item +templates may determine whether the page has an existing item to render. - - we could go for a fully-divorced-from-Zope approach, which would involve - bundling PageTemplates/TAL/ZTUtils in with Roundup, with all the - Zope-specific bits removed. - - we could try to coexist with a Zope installation, but there the problem - would be that Zope includes its own copy of PageTemplates/TAL/ZTUtils and - we'd be installing a version in site-packages, which would be bad. - The latter may allow nicer integration with Zope itself, giving Zope - Roundup users access to acquired information in their templates. We could - get around that by modifying the ZRoundup interface to use the "real Zope" - ZPT. Maybe. +Integrating Code +~~~~~~~~~~~~~~~~ -2. Implement the Roundup infrastructure described in the `implementation`_ - above. +We will install PageTemplates, TAL and ZTUtils in site-packages. If there is a +local Zope installation, it will use its own PageTemplates code (Zope modifies +the module search path to give precedence to its own module library). +We will then install the trivial MultiMapping and ComputedAttribute modules in +the Roundup package, and have some import trickery that determines whether +they are required, and if so they will be imported as if they were at the +"top level" of the module namespace. -- 2.30.2