Using an asset list to loop through contents of page


(Birdg) #1

Hi,

We are using 4.16.0. Is it possible to use an asset list to loop through the content divs on a standard page? The asset list would need to get the Page contents asset dynamically.


What I’m trying to achieve is a two column layout powered by one list of content divs.


If there are any simpler ways of achieving that, I’m all ears.


:slight_smile:


Graham


(Aleks Bochniak) #2

Try listing bodycopy divs and then have a look at Column layout screen of your asset listing.


(Bart Banda) #3

You can also do it with CSS and/or JS if all the content divs are printed with a div around them. My personal recommendation would be to just use JS and it would cover all browsers, and worst case scenario would be that the user would see all divs in 1 column which is certainly acceptable.

 

You could use an asset listing to list the divs but you might run into troubles of ordering them by the order they are in the asset tree if they start moving around. You could use 2 asset listings to first list the page contents asset and then the bodycopies inside it and then sort it by the tree. But it probably isn't worth if when JS would be a simple solution. 


(Birdg) #4

Hi Bart,

 

Thanks for your reply. I can see the benefit of doing it with CSS/JS.

 

Thanks again,

 

Graham