David H wrote:
Jonathan wrote:

----- Original Message ----- From: "Erik Myllymaki" <[EMAIL PROTECTED]>
To: <zope@zope.org>
Sent: Monday, September 11, 2006 12:24 PM
Subject: [Zope] question on URL styling

I am making a survey that has many very similar pages all in one directory.
The page templates are called page-1.html, page-2.html, ... page-n.html.

I am using two submit buttons on each of the pages; one for 'Next' and one for 'Previous' so that I catch changes to the form elements in each direction. I use a python script as index_html, and hit it on each submit (<form action=".">), and then redirect to the appropriate page, whether that page is current_page++ or current_page--. I also stuff all form variables into SESSION in the index_html python script.

What I am wondering though, is how to display the 'page' portion of the address - right now it always just displays as http://myzopesite.com/workingdirectory/

I would like it to display http://myzopesite.com/workingdirectory/page-1.html, http://myzopesite.com/workingdirectory/page-1.html, etc.

The pages are all accessible directly by those names, but by always going to index_html and returning the page via "return container[next_page](context, request)" I never see this part in the URL.

One possible work-around is to rename your python script, reformat your urls and use traverse_subpath to access the page to be displayed. eg. if you name your script 'displayPage', then you can have a url like:


the displayPage script will be invoked and it can then access REQUEST['traverse_subpath'] (which in the above case will contain 'page-1.html').



I find your "use case" a bit strange. Why would your users need to see different URLs? Doesnt that pollute their browser's history list - and do you want them clicking some Page-nn from history?

I'm not too sure I understand the pollution reference...do you mean that it would make sense that an end user would only ever bookmark to the start of the survey, and not half way through?

I guess it's more for me and the designers then for end users.

After the user goes through the 30+ pages of survey questions, they are
presented with a summary page which basically shows all the 'Q's and 'A's and their contact info on one big page "Hi, JOE from CALGARY, you told us that your favourite colour is GREEN, your favourite fruit is a BANANA ... etc.".

There are links beside each answer so that they can go back and change that answer before submitting the survey if they wish. So, they should have access to each and every page by name and they can jump around within the survey.

Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to