Sorting content by ezimage attribute

Author Message

Felipe Jaramillo

Thursday 28 September 2006 2:47:35 pm

Hello all,

We are building a simple ecommerce site and encountered the following problem:

Only 20% of the products have images right now. We would like to disply the products with images first. This means having a fetch for products sorted by image (yes/no) and then other criteria.

It seems the ezimage attribute does not have the sortKey or sortKeyTipe functions implemented.

Any suggestions on how to achieve this?

Regards,

Felipe

Felipe Jaramillo
eZ Certified Extension Developer
http://www.aplyca.com | Bogotá, Colombia

Xavier Dutoit

Saturday 30 September 2006 2:11:02 am

Hi Felipe,

You are right, no sort so far.

kernel/classes/datatypes/ezimage/ezimagetype.php

You can modify it to add string sort features (taken the filename)
See the two sort methods:
kernel/classes/datatypes/ezstring/ezstringtype.php

Or as a boolean (image present/not present):
kernel/classes/datatypes/ezboolean/ezbooleantype.php

Could you post that as an enhancement so ez could add it to the standard version, as I think it'd be useful for everyone ?

X+

http://www.sydesy.com

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 21 2025 16:37:09
Script start
Timing: Jan 21 2025 16:37:09
Module start 'layout'
Timing: Jan 21 2025 16:37:09
Module start 'content'
Timing: Jan 21 2025 16:37:10
Module end 'content'
Timing: Jan 21 2025 16:37:10
Script end

Main resources:

Total runtime1.1392 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 590.2734151.2109
Module start 'layout' 0.00480.0024 741.484436.6484
Module start 'content' 0.00721.1309 778.1328544.9609
Module end 'content' 1.13810.0010 1,323.09387.8438
Script end 1.1391  1,330.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2989160.0002
Check MTime0.00150.1342160.0001
Mysql Total
Database connection0.00070.060610.0007
Mysqli_queries1.097696.3540540.0203
Looping result0.00050.0413520.0000
Template Total1.109197.420.5545
Template load0.00210.181920.0010
Template processing1.107097.177620.5535
Template load and register function0.00010.012810.0001
states
state_id_array0.00130.113810.0013
state_identifier_array0.00080.073020.0004
Override
Cache load0.00170.1502220.0001
Sytem overhead
Fetch class attribute can translate value0.00070.059220.0003
Fetch class attribute name0.00120.103530.0004
XML
Image XML parsing0.00060.056420.0003
class_abstraction
Instantiating content class attribute0.00000.002430.0000
General
dbfile0.00090.0746160.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/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: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs