[Zope] Re: Clever solution wanted

Tille, Andreas TilleA@rki.de
Tue, 22 Jan 2002 13:04:44 +0100 (CET)


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.