[ZDP] ZPT Howto
Tue, 17 Aug 1999 11:44:08 +0200 (CEST)
Hello, I just started a simple HOWTO-customize your ZPT member page. I
will append the start (which is not much, see the rest of the mail) at
the end to get feedback on the style, grammar and scope. I want to
showcase some simple things one can do with simple DTML and zope. But
I got stuck very early :-)
I want to add a special view_source DTML-method, which surpresses the
hole table junk and gives only back the DTML, so one can use this as a
starting point and modify it. But I'm not allowed to access
document_src from my own unchanged view_source, only from the aquired
one. I don't understand this. Any insights?
Then, is there a special format for the HOWTO? Should it be text, or
I can't promise to finish this real soon now :-)
######### > Cut here.
This documents gives some examples to customize the look of your
member page and use for this some technics provided by the
To have a consistent name in the following examples say your name is
zoy :-) and the portal is located at http://Z.P.T !
Before we start, please kill you browser and start a new one, this is
important for the authentication thing.
So there we are. You are now member of the zope community and have a
member page on the zope portal. Go to
there is a list of various other members. If you click on your name in the
list of members you see your page is quite boring and has not so much
To get some more info what you can do, you need to log in. For this
click the 'Log in' link at the left side. You are presented with a
form for login name and password. After successful login you return to
your personal page and see that it's content has changed a little bit. It
remains boring but has some more info for you. There are two new
links. One is to
http://Z.P.T/Members/zoy/manage with a hint to `index_html'
the other to
First try the update_html link. This brings you to a form, where you
can change the info you have given before to become a member. And
there is also a link to the 'manage' page. So we will look there what
we can manage. Ah, this becomes interesting. This looks a little bit
like a file browser. But there are no files or anything else. But if
this is my directory where are 'manage' and 'update_html'?
These documents, let's say objects, are defined somewhere above your
point in the file tree. And let's change from a view of a file-tree to
a view of a tree-like hierarchy of some kind, not just files and
Remember the hint to 'index_html', also this file/object is not
present in your folder you think. But what you see at your member page
is a general 'index_html' acquired from somewhere above, where
information about you, like your login name, is plugged in. And how can
I change it, if I don't see it? you may ask. You provide simply your
own index_html, this blocks the acquisition.
But first some more playful examples for this. Try to go to
You will see the same object as http://Z.P.T/Members . Got a light?
And this can be extended further. You can get hold of anything
beneath 'Members' also. Try
So this is elegant, you will see plenty of it in zope.
Ok, we want to customize your member page. But now we want to have a
closer look, what's already there. Go back to you member page and
scroll down the page. There is link named 'DTML source'. Follow this
and see the actual content of the acquired 'index_html'. If you look at
the location info of your browser, you see, that you are now at
'view_source' is not a document, but a method. See how it looks like and
use the acquired method on itself:
We want to make our own view_source, so we get the DTML source without
all the other stuff we see now.
Mark these few lines and copy them into a file on your computer for
1 <!--#var standard_html_header-->
3 <!--#var "document_src(REQUEST,RESPONSE)" html_quote-->
5 <!--#call "RESPONSE.setHeader('content-type','text/html')"-->
6 <!--#var standard_html_footer-->
Go to your 'manage' page at http://Z.P.T/Members/zoy/manage ....
... to be continued :-)