Skip to content

Commit 6733075

Browse files
author
Richard Jones
committed
more tweaks
1 parent 681ab99 commit 6733075

File tree

1 file changed

+39
-16
lines changed

1 file changed

+39
-16
lines changed

doc/templating.txt

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
HTML Templating Mechanisms
33
==========================
44

5-
:Version: $Revision: 1.9 $
5+
:Version: $Revision: 1.10 $
66

77
Current Situation and Issues
88
============================
@@ -197,6 +197,10 @@ Accesses through a class (either through *class* or *db.<classname>*):
197197
''' return an HTMLItem instance '''
198198
def classhelp(self, ...)
199199
def list(self, ...)
200+
def filter(self):
201+
''' Return a list of items from this class, filtered and sorted
202+
by the current requested filterspec/filter/sort/group args
203+
'''
200204

201205
Accesses through an *item*::
202206

@@ -280,24 +284,43 @@ Multilink HTMLProperty
280284
def __init__(self, ...)
281285
def filterspec(self, ...)
282286

283-
Action
284-
======
287+
Template files
288+
~~~~~~~~~~~~~~
289+
290+
Each instance will have the opportunity to supply the following templates:
291+
292+
page
293+
This is the overall page look template, and includes at some point a TAL
294+
command that includes the variable "content". This variable causes the actual
295+
page content to be generated.
296+
297+
*.index
298+
Displays a list of items from the database, and a "filter refinement" form.
299+
Would perform a TAL ``repeat`` command using the list supplied by
300+
``class/filter``. This deviates from the current situation in that currently
301+
the index template specifies a single row, and the filter part is
302+
automatically generated.
303+
304+
*.item
305+
Displays a single item from the database using the *classname* variable (that
306+
is, the variable of the same name as the class being displayed. If
307+
308+
*.filter
309+
Displays a full search form for a class.
285310

286-
1. Investigate how PageTemplates would be integrated into Roundup:
311+
Note that the newitem template doesn't really apply any more because the item
312+
templates may determine whether the page has an existing item to render.
287313

288-
- we could go for a fully-divorced-from-Zope approach, which would involve
289-
bundling PageTemplates/TAL/ZTUtils in with Roundup, with all the
290-
Zope-specific bits removed.
291-
- we could try to coexist with a Zope installation, but there the problem
292-
would be that Zope includes its own copy of PageTemplates/TAL/ZTUtils and
293-
we'd be installing a version in site-packages, which would be bad.
294314

295-
The latter may allow nicer integration with Zope itself, giving Zope
296-
Roundup users access to acquired information in their templates. We could
297-
get around that by modifying the ZRoundup interface to use the "real Zope"
298-
ZPT. Maybe.
315+
Integrating Code
316+
~~~~~~~~~~~~~~~~
299317

300-
2. Implement the Roundup infrastructure described in the `implementation`_
301-
above.
318+
We will install PageTemplates, TAL and ZTUtils in site-packages. If there is a
319+
local Zope installation, it will use its own PageTemplates code (Zope modifies
320+
the module search path to give precedence to its own module library).
302321

322+
We will then install the trivial MultiMapping and ComputedAttribute modules in
323+
the Roundup package, and have some import trickery that determines whether
324+
they are required, and if so they will be imported as if they were at the
325+
"top level" of the module namespace.
303326

0 commit comments

Comments
 (0)