[Zope] Hiding HTML URL

David H bluepaul at earthlink.net
Mon May 9 14:00:26 EDT 2005


Allen Huang wrote:

> I just want to show my root URL address whenever people browse into 
> other pages of my site. How do  I do this in dtml or python script or 
> external method??
>
> ------------------------------------------------------------------------

Allen,

You can use index_html as a "call dispatcher".  Each ZPT, DTML, etc 
form's action should = "." or "index_html". 

Example:
// .................................
EditForm
// .................................
<head>
<script type="text/css">
function Process() }{
   document.form.action_type.value = "Process"
   document.form.submit()
}
function Cancels() }{
   document.form.action_type.value = "Cancel"
   document.form.submit()
}
</head>
<body>
<h1>my big page</h1>
..
<form action="index_html" method="post>
<input type="hidden" name="caller" value="editform"
<input type="hidden" name="action" value=""
.
.
<input type="button" onClick="process();return false;" value="Process">
<input type="button" onClick="cancel();return false;" value="Cancel">

</form>
# -------------------------------------
index.html (i use python for this)
# -----------------------------------
request = context.REQUEST
if caller == "editform":
   if action_type=="process"
      return context.Main(context,request)
if caller == 'someotherform"
     return context..SomeOtherForm(context,request)   

etc

In this way, you always get your apps root directory as the url.  
index_html handles all requests.

David


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20050509/0c24ca8b/attachment.htm


More information about the Zope mailing list