is selection attribute ok for long list ?

Author Message

laurent le cadet

Wednesday 22 February 2006 6:48:31 am

Hi,

I need to do add a selection attribute to a class.
This selection should have about 125 items.

With this list (single choice), I want to do a {swicth} to retrieve which one is selected and then print out an image depend on the {case}.

It should work but it seems to me to be not very smart.

Is selection is ok for this purpose (long long list) ?
Is there something smarter to do ?

Laurent

Roy Bøhmer

Wednesday 22 February 2006 8:58:11 am

Hi Laurent!

I agree that a list of 125 items seems like a seriously long list :-)
What about using a ezObjectrelation datatype, and let the user relate pre-published objects? The objects they relate to can be of an image class, and contain the image you want to display. In that way you can skip the extremely long switch-statement.
In addition its easier to maintain the "list". I dont like the Idea of changing the defenition of classes all the time. Its also esier to control rights.

Roy

laurent le cadet

Wednesday 22 February 2006 9:11:30 am

Seriously long, really ;))))

Yes, your idea of ezObjectrelation datatype seems to be a better option.

Thanks !

Laurent

Xavier Dutoit

Thursday 23 February 2006 1:22:13 am

Salut,

I'd suggest to use the enhanced object relation: http://ez.no/community/contribs/datatypes/enhanced_objectrelation

I'd classify your 125 items (of class whatever) into logical groups (I'm sure you can group them into smaller groups), so that's easier to manage.

Items (class folder)
- group A (class folder)
-- Item 1 (class whatever)
-- Item 2 (class whatever)
- group G (class folder)
-- Item 125 (class whatever)

As the eor, you param it saying you want to list all the items of the type "whatever" and it work fine, no matter where they are placed in the content tree.

As an added benefit, you can use the reverse relation and when you browse /items/group G/Item 125 you can list all the objects that have selected Item 125.

X+

http://www.sydesy.com

laurent le cadet

Thursday 23 February 2006 1:33:20 am

Salut Xavier,

I never tried this before but it sounds great.

Thanks.

Laurent

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.