I'm having trouble looping over a media folder and getting access to some custom properties that were added to the Image document type (media section). In my example below, no matter what I do, image.externalUrl and image.internalUrl are always empty. How does one work with custom properties?
Not sure what is the problem. What does the xml looks like when you use library.GetMedia(id, false)?
As an alternative you could have a look at the DAMP gallery. The example on page 2 also loops through all the children and on page 3 you see how extra properties can be fetched.
I believe it is a cache issue. I'm not only not able to pull these properties but other media items that were long deleted are still showing up... Is there a way to clear the umbraco MEDIA cache?
I did that.. The issue might be a cache issue on the macro although I don't recall ever having that problem prior. It was set to Cache duration: 0 and Cache by Page: Yes..
I've got the same problem on 4.11.4 - added property to a media item (pdf in this case), does not display or even show as a valid property via razor. Any other fixes around for this?
Dynamic Media Children Properties
I'm having trouble looping over a media folder and getting access to some custom properties that were added to the Image document type (media section). In my example below, no matter what I do, image.externalUrl and image.internalUrl are always empty. How does one work with custom properties?
Screenshot of the Media type: http://screencast.com/t/DD2u7uq4X3Y
Razor (the images display, I can't pull the URL property values):
I think this should work. What happens if you try to fetch the properties with the GetProperty("") method?
Jeroen
It doesn't work with GetProperty either. It is a 4.11.3 site.
Not sure what is the problem. What does the xml looks like when you use library.GetMedia(id, false)?
As an alternative you could have a look at the DAMP gallery. The example on page 2 also loops through all the children and on page 3 you see how extra properties can be fetched.
Jeroen
I believe it is a cache issue. I'm not only not able to pull these properties but other media items that were long deleted are still showing up... Is there a way to clear the umbraco MEDIA cache?
Try this topic: http://our.umbraco.org/forum/getting-started/installing-umbraco/24652-Republish-media-after-upgrade?p=0#comment91536
Jeroen
I did that.. The issue might be a cache issue on the macro although I don't recall ever having that problem prior. It was set to Cache duration: 0 and Cache by Page: Yes..
I've got the same problem on 4.11.4 - added property to a media item (pdf in this case), does not display or even show as a valid property via razor. Any other fixes around for this?
OK upgraded to 4.11.6 and it fixes the bug :-)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.