[ZPT] Varying templates based on location

Michael Long mlong@datalong.com
Tue, 20 Aug 2002 02:03:48 -0400


The structure I outlined previously was rather simplistic as far as all 
of the slots that are actually defined in my site. The reasoning behind 
this method is that I can create the structure of the site in a set of 
files located in the root directory and then replace the contents of 
individual pieces the page based upon the users location in the site. 
It has simplified things immensely since my folders contain data that is 
relevant to that folder only. I am still new to the zope game and am 
going to be venturing into some heavy scripting (Python and SQL) next. 
This may lead me to another approach :).

Mike

> Jean Jordaan wrote:
> > 
> > I think this should be cool though (in macro "page"):
> > 
> >  <div id="content" metal:define-slot="content">
> >  <tal:block content="structure here/content.pt" />
> >  </div>
> > 
> > That way, the 'content.pt' of 'here' is always the default content.
> > Subpages can override.
> 
> Hmmm... you mean pages in subfolders where a different content.pt 
exists in that 
> folder, right? ;-)
> 
> In the abvoe example, why not just have the contents of content.pt 
where you 
> have that tal:block?
> 
> > Although .. unless 'content.pt' was big and ugly, and you 
particularly
> > wanted to keep it out of your 'index_html' or whatever, you could 
just
> > 'fill-slot' and provide the content right there, instead of having
> > 'content.pt' everywhere .. right?
> 
> yup.
> 
> cheers,
> 
> Chris
> 
> 
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://lists.zope.org/mailman/listinfo/zpt
> 
>