How to have multiple loops in Asset Listing


(Vivek) #1

Matrix Version:
Hi
I am looking for a solution where I can have multiple loops in asset listing.
Is there any way where I can use type formats to run multiple loops.
example: in Page contents I can display %asset_listing:1234% this is the first loop
%asset_listing:5678% this is the second loop

Some help will be greatly appreciated.


(Iain Simmons) #2

Hi Vivek,

I don’t think you can use the %asset_listing% keyword in the the way you are describing, but perhaps if you could share a bit more about your use case and what you’re trying to achieve, we may be able to help further.

Are you wanting 2 different sets of assets and producing the same output for both, or one set of assets but producing two different lists?

Or is it more like a nested listing where for each of the outer assets you want to do another loop of its children?

Cheers,
– iain


(Vivek) #3

Hi Iain

In a carousel I am looping multiple images for which I am using %asset_listing%
But that carousel also has a button section which also needs to loop but sits outside the image looping DIV.

The structure looks like

DIV IMAGE - page content
–DIV (LOOP) - %asset_lisitng%
-------IMAGE
– END DIV
END DIV IMAGE - page content

DIV BUTTON - page content
–DIV (LOOP) - %asset_lisitng% - FOR THIS PART I NEED SOME SOLUTION
-------BUTTON
– END DIV
END DIV BUTTON - page content

I hope I managed to explain what I need.


(Iain Simmons) #4

Hi Vivek,

Yes, that makes sense, and I’m sure is pretty common but unfortunately your best bet here is to have two asset listings, one for the images and another for the buttons, with all the same settings but just different page contents and default format, and then nest them both within a common parent div.

Cheers,
– iain


(Vivek) #5

Thanks Iain.
But do you have any examples how to achieve that?