I'm looking for a way to list all media items in a page from the media library.
I've got scripts that will list media in a certain folder but what I need to do is list all media from a certain folder including the media that will be in subfolders.
So
Folder (Start here)
Sub Folder
Media Item
Sub Folder
Media
I would just need to list all the media from the start folder.
So this makes a bit more sense, I'm going to use this to build an xml feed that will be passed into our search collection.
Just as a follow up to this question I now have a working xml feed of all media.
But I have a custom field in the media item for search category.
i.e.
Does anyone know how I get this to output to the page. i.e using @media.contentCategory just gives error CS0118: 'media' is a 'variable' but is used like a 'method'
List all Media Items from Media Library
Hi
I'm looking for a way to list all media items in a page from the media library.
I've got scripts that will list media in a certain folder but what I need to do is list all media from a certain folder including the media that will be in subfolders.
So
I would just need to list all the media from the start folder.
So this makes a bit more sense, I'm going to use this to build an xml feed that will be passed into our search collection.
Any help would be great, thanks.
Hi David
If I understood you right, you need script like that:
It renders all media items from all folders in the unordered list.
Thanks,
Alex
Works perfect, thank you very much.
You are welcome, David. Have a great day.
Alex
Just as a follow up to this question I now have a working xml feed of all media.
But I have a custom field in the media item for search category.
i.e.
Does anyone know how I get this to output to the page. i.e using @media.contentCategory just gives error CS0118: 'media' is a 'variable' but is used like a 'method'
Thanks.
Hi David
Yes, try this code:
Be sure that alias of field is right, as I see from screen your alias is "searchCategory"
Thanks,
Alex
Again perfect, Thanks Alex
You are welcome, David!
Alex
is working on a reply...