Getting a folder to list documents


(Sean) #1

Hello,

Probably a silly question, but I am unable to find anything in the documentation currently.

I am wanting to use JavaScript to get a folder in the structure to list all of it’s documents on the page.

What is the recommended way to get that specific folder? The folder is not directly under the page, it’s in its own resources section.

Thanks!


#2

By folder do you mean a folder asset or director on the system?
If asset you can use the JS API for getting the children and iterating over them.
https://matrix.squiz.net/manuals/web-services/chapters/javascript-api#getChildren

However it might be easier to just use an Asset Listing depending on your development background.
https://matrix.squiz.net/manuals/asset-listing

If directory not in Squiz you’ll need to set something up outside of Squiz.