Python and Zope

maxm maxmcorp at worldonline.dk
Sun Oct 7 11:28:20 CEST 2001


"Magnus" <nixx at telia.com> ...

>  When using <dtml-var myObject> to 'include' files/objects it is working
> well if the files are in the same directory.

Your question can mean several different things, i'll try to answer them.

If you want to build a news site with articles in different folders like:

home/
    general/
        article1
        article2
        article3
    computers/
    Hifi/
        article4
    Politics/
        article5
        article6

And if you then want to have a list of all the articles on the front page
you could either traverse the folders manually

<dtml-call "REQUEST.set('all_articles', general.objectValues() +
conmputers.objectValues() + Hifi.objectValues() + Politics.objectValues())">
<dtml-in all_articles>
    <a href="<dtml-var absolute_url>"><dtml-var title_or_id></a><br>
</dtml-in>

Or you could use the Catalog to to list the articles. This is probably the
best way to do it in the long run and it will be faster too.

regards Max M







More information about the Python-list mailing list