[Zope] - Project I'd like to try. Suggestions?

Amos Latteier amos@aracnet.com
Fri, 11 Dec 1998 10:33:25 -0800


At 12:37 AM 12/11/98 -0800, Tim wrote:
>Hi, all.  I've been a longtime Bobo user and list lurker, and am just
>getting my toes into the deep Zope waters.  I've come up with an idea
>to get myself started at playing with code, and I'd like to get a little
>feedback about how to go about it before I plunge in.
>
>I'd like to design a roll-over button class, where you would have, say,
>two images and a method that spits out some HTML and Javascript to do 
>a rollover sequence.  At first I'd be happy to get just the objects to 
>appear on the web, maybe with a method to upload data, and then turn 
>them into full-blown Products (which I take to mean that they'll be 
>web-editable).  I'll gladly donate this code to the Zope effort if it 
>works out nicely.
>
>Does anybody have any pointers, suggestions, et al before I try to get 
>started?  I am at Zope Zen 0.1 at this point and am still awaiting the 
>lightbulbs (although I know they're there somewhere)...  Is this even 
>the right kind of idea for Zope, or am I still stuck in the ways of Bobo?

Well, I think that this can be done with a Document and two Image objects.
(The following is untested...)

OK start with the roll over doc, put it at the top level of Zope. Call it
'rollover'. Give it DTML to describe how to paint the roll over in HTML and
javascript. For example:

<script language="javascript">
...
</script>
<a src="<!--#var image1-->" onMouseOver="rollover()">

Or something like that, I don't know javascript so don't blame me ;-) The
idea is that you define a template for the rollover and put var tags in for
the fill in the blanks stuff, like the two image names, maybe an href or
alt text...

Then you can access the roll over document in other pages with a var tag:

<!--#var expr="rollover(image1='/images/buttona',image2='/images/buttonb')"-->

This is just a sketch, but the point is: You can build powerful things with
simple objects like Documents and Images. Also, Documents are methods which
are acquired. You just built a method for creating roll overs by defining a
Document. You just gave that method to all the Folders in Zope by creating
that Document at the top level. And you thought you were creating an HTML
page!

Hope this helps.

-Amos

P.S. I'm still pretty low on the Zope Zen scale myself (I'm a Bobohead,
who's still trying to get a good feel for this Zope stuff, like everyone
else.) So, I'd be glad to here other ideas about how to accomplish this too.