[Zope] Re: Zope in intranet - the cool apps?
Simon Michael
simon@joyful.com
Wed, 07 Aug 2002 13:11:29 -0700
Hi Mark, thanks for your post.
Mark Bucciarelli <mark@easymailings.com> writes:
> I didn't find it that hard to integrate zwiki into an otherwise totally
> zpt site. The hard part as far as moving to zpt is to pull all the layout
> code (dtml statements) from the python. For example, all the '<a href'
> stuff.
I'm not sure what you mean here. What did you do with zwiki, exactly ?
> I think it would be better to have the python process a DTML document, and
> return some data structure (list or a dictionary) that the zpt template
> lays out.
Yes, I became a little clearer on this yesterday. Here's how I think zwiki
could approach ZPTs (can I call them Page Templates, or are they Zope
Presentation Templates ?):
1. allow the "forms" - editform, subscribeform & backlinks - to be defined
as ZPTs. Would mean changing editform(), backlinks() & subscribeform().
2. allow the main page layout to be defined as a ZPT
("standard_wiki_page", "page_layout", "mainview" ?). Would mean
changing (or adding new) render_ methods. Currently they all render and
pre/append the DTML methods to the rendered page content as their final
step. Instead they would now render the ZPT, passing the rendered page
data into it's namespace for inclusion (right ?).
At this stage,
- you should be able to fully control the wiki's appearance by editing
these four ZPTs.
- ZWikiPage still inherits from DTML Document, and dtml-enabled wikis and
pages such as zwikidotorg's default UserOptions, RecentChanges and
SearchPage still execute embedded dtml.
- the ZPT provides an additional dynamic parsing stage for the page, where
you can do site-wide, admin controlled stuff - sounds useful
3. implement UserOptions/RecentChanges/SearchPage in some other way than
DTML, allowing you to purge DTML entirely from your wiki. For those who
want that. :) (Personally, I want embedded restricted python).
4. make it so that each zwiki page is a ZPT. This should make it easier to
edit a page with WYSIWYG tools. After an edit, zwiki would extract the
essential body (eg strip the header & footer) for inclusion in the
standard site ZPT.
-Simon