Given that database calls are minimised in Umbraco using the umbraco.config files. Is there anyway when using the 'Media Picker' as a document property on the document type, that you can retrieve the path to this image without hitting the database? How come only the media item node Id is stored in the Umbraco config and not the path to the image upon publishing? I do most of my node work back end to create objects based on the document type using c# and I have been using GetMedia or code such as the following (below), is there another way I am unaware of to get the path to the image without it hitting the DB? Cheers
var media = new umbraco.cms.businesslogic.media.Media(nodeId);
Umbraco Media Picker Get Image Path
Given that database calls are minimised in Umbraco using the umbraco.config files. Is there anyway when using the 'Media Picker' as a document property on the document type, that you can retrieve the path to this image without hitting the database? How come only the media item node Id is stored in the Umbraco config and not the path to the image upon publishing? I do most of my node work back end to create objects based on the document type using c# and I have been using GetMedia or code such as the following (below), is there another way I am unaware of to get the path to the image without it hitting the DB? Cheers
var media = new umbraco.cms.businesslogic.media.Media(nodeId);
var file = media.getProperty("umbracoFile");
ReviewThumbnailImage = file.Value.ToString();
You can find more info here: http://our.umbraco.org/wiki/reference/umbracolibrary/getmedia
You could also try DAMP. It can store the complete media in the umbraco.config xml.
Jeroen
is working on a reply...