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.