Fetching 4000 items?

Author Message

Jorge estévez

Tuesday 06 October 2009 7:30:37 am

Hello,

I have uploaded lots of images to Media, each one of them named with a unique product code. There are 4000 images.

When I display a product I must fetch images (already uploaded at media) compare the product's code with the image name and show the image at the browser page.

Fetching so many images to iterate and compare to the product's name is time and resource consuming.

Is there any other solution worth trying?

Fetch node where name is CODE-XXXX, as images have unique names? Could something like this be efficient?

Any help... thanks!

Diseño Web Cuba
Web Design Cuba
www.elfosdesign.com

Tero Auralinna

Tuesday 06 October 2009 9:19:52 am

Attribute filter will do the trick.

Something like this

{def $images = fetch( 'content', 'list',
        hash( 'parent_node_id', 51, 'attribute_filter', array( array( 'image/name','=', 'CODE-XXXX' ) ) ) )}

NXC Finland - Open Source solutions, Internet marketing and web analytics
http://www.nxc.fi
http://www.auralinna.fi
http://twitter.com/teroauralinna

Gaetano Giunta

Tuesday 06 October 2009 9:31:20 am

You might as well consider:

- using an object relation(s) attribute to link images to products

- add a secondary location to existing images so that they become children of the corresponding products

Basically trading editing time for faster access...

Principal Consultant International Business
Member of the Community Project Board

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