Forums / Developer / ezImage Gallery skips content

ezImage Gallery skips content

Author Message

Torbjørn L.

Wednesday 08 June 2011 6:55:53 am

Hi,

I have an ezimagegallery that I combine with ezmultiupload, and to my horror some images gets skipped in the next/prev images button.

I list out the array of images in that particular gallery and they jumbles some of the images, effectively skipping those.

I also experienced that the next array just deleted one image when I listed them out.

Anybody has anything to help me with here?

the code for next and prev array:

 {def $all_images = fetch( 'content', 'list', 
hash( 'parent_node_id', $node.parent_node_id,
'class_filter_type', 'include',
'class_filter_array', array( 'image' ), 
'limit', '20', 
'attribute_filter', array( 'and',
array( $sort_column, $sort_order|choose( '>', '<' ), $sort_column_value ) ),
'sort_by', array( $sort_column, $sort_order|not ) ) )}
{foreach $all_images as $indexnr=>$currimg}
{$indexnr}: {$currimg.name}<br />
{/foreach}
<br/>
{def $all_images_next = fetch( 'content', 'list', 
hash( 'parent_node_id', $node.parent_node_id, 
'class_filter_type', 'include',
'class_filter_array', array( 'image' ),
'limit', '20',
'attribute_filter', array( 'and', 
array( $sort_column, $sort_order|choose( '<', '>' ), $sort_column_value ) ),
'sort_by', array( $sort_column, $sort_order ) ) )}
{foreach $all_images_next as $indexnr2=>$currimg2}
{$indexnr2}: {$currimg2.name}<br />
{/foreach}

André R.

Thursday 09 June 2011 6:57:02 am

This was fixed in 4.5 (and the two community builds so far), take a look there.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Torbjørn L.

Tuesday 14 June 2011 4:07:15 am

I rebuilt the select statement and made it into one foreach with three if checks and a break.

Like this:



{def $nextimg='false'}
{def $nextimg_obj=0}
{def $previmg='false'}
{def $previmg_obj='false'}
{foreach $node.parent.children as $thechild}
{if $thechild.class_identifier|eq('image')}
{*3*}
{if $nextimg|eq('true')}
{set $nextimg_obj=$thechild}
{set $nextimg='false'}
{break}
{/if}
{*2*}
{if $thechild.node_id|eq($node.node_id|int())}
{set $nextimg='true'}
{set $previmg_obj=$previmg}
{/if}
{*1*}
{set $previmg=$thechild}
{/if}
{/foreach} 

But thanks for the suggestion