June 16th, 2004, 09:32 AM
Zope - Editable Homepage
I'm starting out with Zope.
As a learning excercise I would like to setup a homepage with 3 paragraphs on it. Each paragraph should be editable by an 'editor' user role. This would allow the editor to change the text on the homepage, but without having access to the 'manage' Zope interface, and thereby being unable to alter the structure of the page.
I've created a page template called 'index_html' and added some attributes via the manage interface to it. Then I created another page template called 'edit_homepage' which is basically a form. The idea is the form will show the current values of the 3 attributes in textarea's for the editor to change.
I would then like to press the submit button and have the attributes updated - but I've no idea how to do this at all.
The form doesn't work and produces an error to the effect that it can't find the para1...para3 attributes. I've tried here/para1...template/para1....index_html/para1 but always the same type of error.
Am I on the right track, or have I made a fatal flaw with my understanding of Zope?
My thinking was that the url for the editor to access the attributes via would be http://www.sitename.com/edit_homepage
I'm wondering if I should create a zClass called 'homepage' with the 3 attributes in it, and then refer to this in the template form? But then how would I go about updating it in the zodb?
June 16th, 2004, 10:35 AM
The one thing that jumps to mind is you didn't mentioned a database/storage of any type or where the data for the home page is being stored and loaded from.
Obviousy you will want to edit or add to this source using the form, which will then be displayed on the page. This is a fundimental consept of data driven design .
So where is the page loading its data from?
In any case all you have to do - if i've understood you right - is work out how to access this source and change its values. Then it should work fine.