[Zope] Newbie: Two questions regarding DTML.

Bill Anderson bill.anderson@libc.org
Fri, 09 Jul 1999 19:59:25 -0600


Rachid van Es wrote:
> 
> Bill Anderson wrote:
> > Quite frankly, I love it.
> > I use it at work for my Support website (internal lan, no URL :-( ), as
> > well as for the Linux in Boise Club website (shameless plug:
> > http://www.libc.org), as well as for two upcoming sites. Given that I
> > love Python and don't *really* need all that apache has to offer, I run
> > the Zserver straight up. Currently, I am working on something I suspect
> > may be in the PTK: a banner ad product.
> 
> My project does involve major stuff, so it has to run on a 'foreign' server.
> On my local machine it runs on the included server. Nice enough. I took a
> look at libc.org, looks nice, runs under zope? Could you send me the dtml
> code of that? I'm having trouble getting to grips with it all, I keep
> running into what I see as limitations. Especially the database approach, I
> hate that! Our server runs under WinNT, so that makes Zope soooo slow!

Sure. Most of the work for the site look is in the
standard_html_[head|foot]er, with the exception of the Community site
(Squishdot), and the main page (pure html).

> 
> > Not sure what you mean about the caching, but I'll try. It is my
> > understanding that once served, the page (non-dynamic only?) is cached
> > on the server side. To be served up new requires the browser to decide
> > if it needs a new version of the page, or the cached version will do.
> 
> Yeah, but I thought the whole deal about Zope was dynamic pages. The way I
> do my pages now is by having the <!--#var header--><!--#var
> navbar--><!--#var title--><!--#var subtitle--> which don't change from
> parent to child, combined with <!--#var content_zope-->.
> 
> Now this 'content_zope' will be a generated file, but if Zope doesn't allow
> for fast serving of these kind of pages, I might as well whip up a
> CGI-script to generate static html and run it all from a normal (lightning
> fast) server, right?

As I understand it (anyone care to affirm or correct me ?), Zope stores
the pages (objects) in a cache, which is served out to the browser. By
dynamic pages, I meant those pages which the content changes based upon
various variables, which sould be useless if cached. The cache
parameters are managed via the control panel. 

For example, the links page on www.libc.org is generated from an SQL
query. IMO, this should not be cached, since I could forsee problems if
it were (more so in other cases but you get the idea). 

Given that the SQL queries are done using Python, and there is no
additional overhead.


Now on to the DTML
-------header------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
 	<HEAD>
  		<TITLE> <!--#var title--></title>
		<link href="/Styles/primary" rel="stylesheet" type="text/css">
		<body bgcolor="white">
		
	<table border=0 cellspacing=2 cellpadding=2 width=100% NOSAVE
valign=top>	
		<tr>
			<td align=left valign=top width=40>
				<img src=Images/SideBanner width=39>
			<td valign=top bgcolor=#fff0f5>
				<h2> Directory </h2>	
				<!--#tree expr="PARENTS[0]" single="1" skip_unauthorized="1" 					 	
branches_expr="objectValues
					(['Folder','Confera Topic','Squishdot Site'])"-->
			  	<A HREF="<!--#var absolute_url-->" ><!--#var title--> </A>
				<!--#/tree--> 


				&nbsp&nbsp  <a href='./../'>Up one level</a>
				<hr>
				<center><a href=http://www.zope.org><img src=/Images/ZopeButton
height=34 width=80 border=0></a></center>
			</td>
			<td valign=top bgcolor=#fffaf0>
</HEAD>

-----------end----------

Note in the 'up one level' link the "./../". i found this _neccessary_
to get it to function properly.
I use a convention of /Styles and /Images for site-wide css and images.


---------footer---------

			</td>
		</tr>

	</table>
</BODY></HTML>
--------end---------

This basically cleans up.

Any questions ask.

Bill