[Zope] 'Edit This Page' ... a simple solution

David Robson robson555@yahoo.com
Thu, 14 Oct 1999 08:14:08 -0700 (PDT)


A few days ago I posted the Q below and got several
great responses. For my first time around, I’ve
implemented the easiest solution. The writing below is
deliberately simplified for my high school students.

-=-=-=-=-= Question -=-=-=-=-=-

Can someone please point me to code that will 

<> display an ‘Edit this page’ link on pages for which
the viewer has edit permission
<> redirect user to an ‘edit & save’ window
<> hide the link from other users


-==-=-=-=- Simple Solution =-=-=-=-=-=

Go to the root level of Zope. Click on the Security
tab and add the role 'Editor'. Select checkboxes to
give Editor these Permissions:

Access contents information
Add documents, images, and files
Add folders
Change DTML Documents
Change DTML Methods


Create a test folder something like...
ID: TestEdit
Title: Test of User Editing

Open the TestEdit folder, then the acl_users folder.
Create a new user (Bob)give him a password (bobpw),
and assign him the role Editor. Bob is now ready to
add or edit any of the contents of the TestEdit
folder. 

However, if Bob enters the site as an Anonymous user
he will not (unless he knows some Zope) be able to
access the management screen where he can open and
edit a DTML document or method. Here's a simple
(kludgy?)way to get Bob into his own pages. 

At the Zope root level, open Standard_HTML_footer. The
original code looks (I think) like this:

<p><!--#var ZopeAttributionButton--></p>
</BODY></HTML>


Revise it like this:

<p><!--#var ZopeAttributionButton--></p>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
<font size="-1">
<a href="manage_main">Edit page</a> (password
required).</font>
<BR><BR></BODY></HTML>

This will put an 'Edit page' link on the bottom of
each page, but the link will normally not be seen
because the many <BR> line breaks will push the link
below the bottom of the screen. Editors will be
instructed to scroll down to find the link. When an
editor clicks on the link she will be instructed to
enter her name and password before gaining management
access to the content pages. 

-=-=-=-=-=-

This approach is far from elegant but it works...

Suggestions welcome!


Dave Robson



=====

David Robson            robson555@yahoo.com
Computer Support        Towson High School, MD, USA

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com