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.

eZ debug

Timing: Jan 30 2025 21:37:01
Script start
Timing: Jan 30 2025 21:37:01
Module start 'layout'
Timing: Jan 30 2025 21:37:01
Module start 'content'
Timing: Jan 30 2025 21:37:02
Module end 'content'
Timing: Jan 30 2025 21:37:02
Script end

Main resources:

Total runtime1.5347 sec
Peak memory usage8,192.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.2500151.2266
Module start 'layout' 0.00550.0046 739.4766220.7188
Module start 'content' 0.01011.5237 960.19534,506.7813
Module end 'content' 1.53390.0008 5,466.976611.8125
Script end 1.5347  5,478.7891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.2487160.0002
Check MTime0.00130.0868160.0001
Mysql Total
Database connection0.00050.032210.0005
Mysqli_queries1.432493.3299650.0220
Looping result0.00070.0479630.0000
Template Total1.460695.220.7303
Template load0.00200.129820.0010
Template processing1.458695.038220.7293
Template load and register function0.00150.096410.0015
states
state_id_array0.00560.365910.0056
state_identifier_array0.00230.152820.0012
Override
Cache load0.00170.1135440.0000
Sytem overhead
Fetch class attribute can translate value0.00190.122230.0006
Fetch class attribute name0.00210.138070.0003
XML
Image XML parsing0.00280.181630.0009
class_abstraction
Instantiating content class attribute0.00000.001290.0000
General
dbfile0.00270.1752220.0001
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs