[Zope] Find object in a directory question

Chris Niekel chris-zope@mimar.demon.nl
Sun, 19 Mar 2000 14:14:20 +0100


Hi,

I've created a ZClass 'CLink', which contains a URL, title and such things.
In my dtml-pages, I can do <dtml-var slashdot>, and the slashdot-clink
object will insert the <a href=...></a> stuff for me. I've got this 
working using the Renderable class. 

I've planned to put all CLink objects in the /links folder so I can
automatically create 'bookmarks' out of the links I reference to. I also
want to be able to categorize the links into subfolders, so I want to have
a links.sports.ski.resorts directory with ski resorts, and a
links.news.nerdish folder for nerd-related news. 
I can use <dtml-var links.news.nerdish.slashdot> to refer to the slashdot
object that way. 

However, I want to easily change my categories, without changing all
<dtml-var ...> that reference object in the categories. So I figured, I'd
make it <dtml-var links.find('slashdot')>. This should one day be the same as
<dtml-var links.news.slashdot> and the next day the same as
<dtml-var links.news.nerdish.slashdot>. With my external method (which only
looks in the current folder so far), I can't get this to work. 

Any ideas? Would the same be easier or simpler using a ZCatalog? 
Refering to a link should not be too much typing. 

As an extra question: is it possible to refer to an object in multiple
places, like softlinks (or hardlinks) in unix? Suppose I have a folder with
'My Frequent internet-visits', and 'News', they could both contain the same
CLink. Is that possible in zope?

Well, hope I made anysense..
Thanks,
    Chris Niekel