Share » Forums » Setup & design » Navigate through related images

Navigate through related images

Navigate through related images

Tuesday 18 November 2008 3:58:32 am - 2 replies

Modified on Tuesday 18 November 2008 12:41:24 pm by Robert Malevic

Author Message

Maxime Thomas

Tuesday 18 November 2008 11:53:29 pm

Hi,

I'm not sure your code is the best way to reach your aim.
I would have done this like this :

{def $count=$node.data_map.images.content.relation_list|count()
      $offset=0
      $object=''
}

{if $view_parameters.offset}
{set $offset=$view_parameters.offset}
{/if}

{def $obj=fetch('content', 'object',hash('object_id', $node.data_map.images.content.relation_list[$offset].contentobject_id))}
{attribute_view_gui attribute=$obj.data_map.image image_class='original'} 
{undef $obj}
{if $offset|gt(0)}
<a href="{$node.ul_alias|ezurl('no')}/(offset)/{$offset|dec()}">Previous</a>
{/if}

{if $offset|lt($count)}
<a href="{$node.url_alias|ezurl('no)}/(offset)/{$offset|inc()}">Next</a>
{/if}

Cheers

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

Robert Malevic

Wednesday 19 November 2008 12:06:17 am

Hi Maxime,

Your solutions works and is exactly what I was looking for. Hopelfully more inexperienced programmers like me can benefit from it.

Thanks!!!

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu