[Zope] Where to put common elements (was : newbie questions)

happyrhino@usa.net happyrhino@usa.net
28 Aug 99 11:13:37 MDT


Sorry, I forgot to put a subject in origial post.

Thank you for the help, Kevin.

>>#2. I want to put all of my images in a folder called "images".
>>    If I read the documents right, I can access the contents of
>>    a folder using
>>    <dtml-with foldername>
>>    <dthml-var imagename>
>>    </dtml-with>
>>    But that is not working. If I place that code inside the root
>>    index_html after the standard_html_header  then view the page,
>>    I get a "save as" popup as if the content type is wrong !
>
>Hmm... this should work
><dtml-with images>
><dtml-var imagename>
></dtml-with>
>
>Should result in the creation of an <img> tag pointing to that image. 

That's what I tried but you guessed the real source of my errors.

>Did
>you upload your images as "Image" objects or as "File" objects?

Duh, that was the problem !. I can see myself repeating that mistake
a few more times before it becomes second nature.  



>>  Also, how would I access the contents of subfolders of subfolders ?
>>   <dtml-with foldername/subfolder>  or <dtml-with foldername.subfolder>
>>
>You could do:
><dtml-with foldername>
> <dtml-with subfolder>
> </dtml-with>
></dtml-with>
>
>Or, I believe, <dtml-with "foldername.subfolder">
>(Note the ""s. Those are important)

Ah, I missed the quotes previously. I just tested it and it works great. Thank
you. Definitely better than the nested 'with's too. 

I've been playing with Zope all night and morning. It's pretty good for
prototyping.   But it's becoming a bit  crowded in the root directory where I
have over 30 common elements (ranging from database connections to navigation
menus to javascripts and stylesheets). I can see this becoming an
organisational nightmare for very large sites. 

It would be great to have the following folder structure
+ common_elements
  + javascripts
  + images
  + stylesheets
  + database_connectors
  + navigation_menus
+ folderA
+ folderB

But I can't work out how to reference the objects inside the subfolders 
of the 'common_elements' folder accessible by the documents in folderA 
and folderB. Unless I put <dtml-with common_elements> into the
standard_html_header and </dtml-with> in the standard_html_footer but 
this will fail if I wish to over-ride standard_html_header in folderA or
folderB. It also pollutes the namespace unnecessarily for documents 
inside folderA that do not actually require the common elements.

Does anyone have any recommendations for organizing folders and common
elements as above ?

TIA,

Henry

____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1