[Zope] Re: [Zope-CMF] ZPT and CMF

Paul Winkler slinkp23@yahoo.com
Tue, 2 Oct 2001 17:55:25 -0400


On Tue, Oct 02, 2001 at 03:27:13PM -0400, Nat Harari wrote:
> But I am a designer, foremost. I'm not a coder. 

Meaning what? Can you at least read html and write html by hand?  If
not, you're going to have a very hard time getting this stuff to work.

> And reading lines of code doesn't explain much to me at all. I was hoping that with
> WebDAV, I wouldn't really have to learn much code at all.

> http://www.somethingwonderful.com/misc/aim4.jpg 
> That is a mock-up of
> what I am trying to make, using Zope, CMF, and Blark. That is what I
> have to have ready by Monday.

Yeeow. That's not much time!

> It isn't all that hard to create in Dreamweaver, but I'll be damned
> if I understand how to make it work with Zope without some sort of
> visual tutorial that a newbie like myself can learn. As you can see,
> it uses most everything that Zope/CMF/Blark uses, and almost exactly
> in the same format. I just need to know how to change some things -
> like move them around

OK, that *might* work. But I think it will be very hard. I honestly
don't know if you're ready to pull this off.

ZPT is supposed to make it easier for a site designer to design stuff
without caring how it works, while a site developer makes it work
without caring how it looks. It doesn't magically enable you to avoid
needing a developer if you need a developer.

But CMF is supposed to let you set up a portal without being much of a
developer. So in theory, it's possible to do what you want. In
practice, CMF and ZPT have not been used together until recently and
there just isn't any documentation of the sort you're looking
for. You'll be pioneering a new technique, travelling in a hurry
without a road map. I wouldn't want to be in your shoes.

If you can look at a demo CMF site and imagine what you want each part
to say, that's helpful. If you want something to *behave* slightly
differently than how it does in CMF... that takes code.

So here's what I suggest. It might be a long shot, but it might be
worth a try.

You need to customize a CMF skin. Skins exist to make it easier to
change the look of a CMF site. Partly so users can select their
favorite skin, but partly also to make it easier for you and me to
create a new look.

Unfortunately, what you need is a ZPT skin, and CMF doesn't come with
one by default. You need the CMFDecor product.

And that brings up another problem... You can currently only get the
CMFDecor product (as far as I can tell) from CVS. You can browse it at
cvs.zope.org, but to download you'll need a cvs program. Never heard
of CVS? I suspect you don't have time for that now. Ask me and I'll
mail you a copy of CMFDecor.

Once you have CMFDecor in your zope Products directory,
follow these instructions:
http://cmf.zope.org/Members/teyc/skinPageTemplate/view

That will set you up with all the skin ZPT files on your filesystem,
so you can edit them there and not have to deal with WebDav or FTP or
whatever. Changes you make should appear on the running zope site. I
think.

Be careful to keep an unmodified copy of CMFDecor around in case you
screw something up by accident.

Now, on the filesystem, look around in CMFDecor/skins. In particular,
look in zpt_content, zpt_control, and zpt_generic. Most things you
want are probably in zpt_generic.

For example, main_template.pt is probably the one you care the most
about. It changes how everything else looks: where the menus go and
what they look like, etc. This template also makes use of a css
stylesheet, zpt_stylesheet.css.

actions_box.zpt is the box that shows your user name and any actions
the user can take on the current page, like logging out, changing your
preferences, etc.

index_html.pt is the portal home page.

I haven't figured out all the rest yet - I'm just looking at this
stuff now.

It's important to understand that with Page Templates, an individual
page might not look like much when you edit it directly, but when you
see it on a running Zope site it's getting wrapped in other templates
(usually, in this case, main_template.pt). For example, if you look at
index_html.pt directly in a browser, it doesn't look like much of
anything. Hell, it's only 26 lines long. But it uses main_template,
and then it displays the title of your portal, and the description you
gave when you set up the portal, and then inserts news_box.

If you can't manage to figure out which files correspond to which
parts of the interface, you're f*cked I'm afraid. CMF is big, the ZPT
skin is new, and there's not really any map that I know of that
explains what it all does. You have to find out by reading the .pt
files.

So with any luck, you might be able to edit these templates in
Dreamweaver and move things around on the page without breaking your
portal. We can hope.

-- 
................    paul winkler   ................
 custom calendars:   http://www.calendargalaxy.com
   A member of ARMS:   http://www.reacharms.com
        home page:  http://www.slinkp.com