Forums / Setup & design / is selection attribute ok for long list ?

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

eZ debug

Timing: Jan 18 2025 10:59:55
Script start
Timing: Jan 18 2025 10:59:55
Module start 'content'
Timing: Jan 18 2025 10:59:55
Module end 'content'
Timing: Jan 18 2025 10:59:55
Script end

Main resources:

Total runtime0.1560 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 587.8281180.8281
Module start 'content' 0.00570.0048 768.656397.9297
Module end 'content' 0.01050.1454 866.5859526.6250
Script end 0.1559  1,393.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00352.2712200.0002
Check MTime0.00140.9199200.0001
Mysql Total
Database connection0.00070.444010.0007
Mysqli_queries0.107368.74701410.0008
Looping result0.00150.95731390.0000
Template Total0.145193.010.1451
Template load0.00100.640810.0010
Template processing0.144192.363810.1441
Override
Cache load0.00070.465310.0007
Sytem overhead
Fetch class attribute can translate value0.00080.517110.0008
XML
Image XML parsing0.00040.226310.0004
General
dbfile0.00402.5878200.0002
String conversion0.00000.003230.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs