[Zope] Wrapping pre-existing content

Mario Valente mvalente@ruido-visual.pt
Thu, 08 Mar 2001 12:33:08 +0000


>> At 10:52 3/8/01 -0000, Phil Harris wrote:
>> >I have a hierarchy of 'documents', lots of them circa. 300 and the number
>> >will continue to grow (dramatically).
>> >
>> >These 'documents' could be of any type, XML/HTML/Images etc.
>> >
>> >What I want to do is to have some way of wrapping these documents to
>include
>> >a header and footer, but I want to do this at render time not before.
>> >
>> >
>>

>>   Put a single index_html file at the Zope root. This should contain your
>>  standard layout (header, footer, sidebars, etc)
>>
>>   Now, assuming you put each doc into its own /document subfolder
>>  and renamed it 'content', simply edit index_html (at the root) and
>>  introduce a <dtml-var content> call where the content should appear.
>>
>>   Through the wonders of acquisition you should be able do request
>>  /document/a , /document/b , etc. and see your documents enclosed
>>  within your layout. 

At 12:11 3/8/01 -0000, Phil Harris wrote:
>If only things were that simple.
>
>The hierarchy is deep, wide and heavily populated at each node.  The number
>of folders is out of my control, as is the number of 'documents' in each
>folder, as is the type of documents.
>
>I need a selective way of wrapping as well as all-encompassing way, e.g. I
>don't want to wrap Image or other binary types.
>

  Then what about replacing that <dtml-var content> call in index_html 
 with (aproximate code...)

  <dtml-in objectValues('Document')>
     <dtml-var sequence-item>
  </dtml-in>

  In this way you would render only the objects within a certain folder
 and by specifying the Meta type you should be able to select those
 you want. Once again remember that through acquisition index_html
 (which should be a method BTW) will apply the layout in index_html
 at the folder where its called (through the URL).

  C U!

  -- Mario Valente