Re: [Zope] Clever solution wanted
At 12:09 22-01-2002 +0100, Tille, Andreas wrote:
I have the following problem: The web pages of our institute has a menu frame (please don't throw anything at me about the frames - I do not like it but now I have to cope with it) with links. Those links have the following structure:
<a href="URL1"> target="target-frame1">text1</a><p> <a href="URL2"> target="target-frame2">text2</a><p> <a href="URL3"> target="target-frame3">text3</a><p> ...
I'm looking for a more clever solution than I could imagine (as a quite beginner in Zope).
Create a ZClass called MenuItem which has 3 properties (urlText, targetFrame, displayText). Inside a folder called Menu (or whatever) allow only the creation of class MenuItem instances (objects). Your editors should be allowed to instantiate how many of those they want (you should probably use some kind of object Id generation; dont let the editors choose the ids themselves). The only other item in this folder should be a DTML method with something like this <dtml-in "objectValues(['MenuItem'])"> <a href="<dtml-var urlText>" target="<dtml-var targetFrame>" > <dtml-var displayText> </a> <p> </dtml-in> If you put this "Menu" folder on the root of your Zope, you can call the menu anywhere with a simple <dtml-var Menu> C U! -- Mario Valente
On Tue, 22 Jan 2002, Mario Valente wrote:
Create a ZClass called MenuItem which has 3 properties (urlText, targetFrame, displayText).
Inside a folder called Menu (or whatever) allow only the creation of class MenuItem instances (objects). Your editors should be allowed to instantiate how many of those they want (you should probably use some kind of object Id generation; dont let the editors choose the ids themselves). The only other item in this folder should be a DTML method with something like this
<dtml-in "objectValues(['MenuItem'])"> <a href="<dtml-var urlText>" target="<dtml-var targetFrame>" > <dtml-var displayText> </a> <p> </dtml-in>
If you put this "Menu" folder on the root of your Zope, you can call the menu anywhere with a simple <dtml-var Menu> I had quite a similiar idea (not as elegant as yours) but the problem is that I would have to include a "Sort"-property which would give the ability to arrange the entries in a specific order. I can not imagine an easy solution which enables this. That's why I thought storing it in a kind of file would be the solution which fits our needs because those people who care for the menu are able to use text editors for thos purposes.
Any idea how to solve the ordering problem with your solution? Kind regards Andreas.
participants (2)
-
Mario Valente -
Tille, Andreas