Forums / Setup & design / combine sections slideshow

combine sections slideshow

Author Message

Martin Ulrich

Tuesday 06 April 2004 10:26:41 am

for an idiot like me, who never learned any basics its a problem:

for my javascript- slideshow I want the path to the image and separate count of the image

that should be the result:
[1] Number = var/storage//var/gallery/storage/images-versioned/... 1.png
[2] Number = var/storage//var/gallery/storage/images-versioned/... 2.png
[3] Number = var/storage//var/gallery/storage/images-versioned/... 3.png

the following loops me the path of image - (works fine, no problem):

      slide=fetch( content, tree, hash( parent_node_id, $node.node_id,
											limit, $image_limit,
                                            offset, $view_parameters.offset,
                                            class_filter_type, include,
                                            class_filter_array, array( 'image' ),
                                            sort_by, array( 'published', false() ) ) )
{section var=image loop=$slide}
{$image.item.data_map.image.content[small_h].full_path}
{/section}

And the following loops me the image count - dito no problem:

number=fetch( content, list_count, hash( parent_node_id, $node.node_id,
                                            limit, $image_limit,
                                            offset, $view_parameters.offset,
                                            class_filter_type, include,
                                            class_filter_array, array( 'image' ),
                                            sort_by, array( 'published', false() ) ) )
{section var=image loop=$number}
[ {$image} ]
{/section}

But what I want is, these both result in one line, like:
[1] number = var/storage/var/gallery/storage/images-versioned/... 1.png

I havent any idear what i should write. How is it possible to fetch two different arrays together, resp. loop two results in one line.
How to combine these two results in one line?
Perhabs I have to combine the two sections somehow, but dont know how.

perhaps there is a nice human beeing out there, who gives a tip.

thanks in advance. :-)

Greetings Sebastian

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

Martin Ulrich

Tuesday 06 April 2004 10:31:50 am

The following, two functions, for example does NOT work:

slide=fetch( content, tree, list_count hash( parent_node_id, ...

_______________________

http://artenic.de ARTENIC - Publishing mit allen Mitteln!

Tore Skobba

Tuesday 06 April 2004 11:03:07 am

Hi

I am not sure what you want. But you can not count each image, or you can count it, but it would always be one and as such not make much sense.
>
>slide=fetch( content, tree, list_count hash( parent_node_id,
>
This will not work, as you basically are asking for two values, the number of children and an array with all the children (including children children etc.. tree).

fetch (content, tree_count, hash (... will return the number of children, including childrins childrens etc.
fetch (content, list_count, hash (.. will return the number of children of THIS node
while
fetch (content, tree OR fetch (content, list will return an array with all the objects.

Hope it helps, if not you need to elobrate on your problem.

If you want to count each image then one solution could be like this
{let count=0
images_list=fetch (content, tree, ...)
}

{section loop=$images_list}
{set i=i:inc} (Increase i with one for each image)
{$item.data_map.image.content[small_h].full_path}
<p>Image number: {$i} </p>
{/section}
{/let}
Note, it is pseudo code and does not work as it is.

Cheers
Tore