[Zope] root level referencing + minimalist zope strategies

Tony McDonald tony.mcdonald@ncl.ac.uk
Mon, 25 Oct 1999 10:39:42 +0100


At 3:33 pm +0200 23/10/99, Jason Cunliffe wrote:
>I have sub-folders called 'images' in my site where only graphics for those
>contexts are kept there.
>I also have a top level folder called 'images' where to store navigation
>bar graphics, company logo, etc.
>
>/
>	/images
>	/folder1
>		/images
>	/folder2
>		/images
>	/folder3
>     --no images folder here yet
>
>a simplified basic standard_html_footer looks like this:
>
><p>
><a href = />
>  <dtml-var "images.logo.tag(border=0, alt='Go to Top Menu')">
></a>
></BODY></HTML>
>
>This is acquired by folders below root level.
>This works fine everywhere index_html calls standard_html_footer where
>there are no local subfolders named 'images'.
>
>I can of course 'fix' this by implementing local standard_html_footer
>methods in the subfolders. But I want a cleaner, minimal, more zopish way
>to automate the folder level awareness. I've almost 'got it' about the
>namespace stuff... I have tried tweaking the method above by adding
>
><dtml-with /images> or <dtml-with "/images"> - but that's wrong...
>
>1. What site wide logic to install for this?

<p>
<a href="/>
<dtml-with "PARENTS[-1]">
<dtml-var "images.logo .tag(border=0, alt='Go to Top Menu')">
</dtml-with>
</a>
</BODY></HTML>


>2. In general, how do you reference the root level "/" with the various forms:
>
><dtml-var> or <dtml-in> or <dtml-with> <dtml-let> ??

<dtml-with "PARENTS[-1]">
</dtml-with>

gets you the root level.

>3. I want to set a variable "myelevel" using for example <dtml-let mylevel
>= /refrences/new">.
>So that I can then call:
>
><dtml-var mylevel.images.newlogo>

Something similar to this was mentioned a few days ago on the list, 
but not exactly in the context you want. I don't have the exact 
reference.

hth
tone
------
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2