I successfully access the umbracoFile, UmbracoExtension, description (a custom property), Id and Text properties. How does one reference the 'Last Edited' property associated w/ a Media object of type 'Media File'? I've tried 'LastEdited', 'LastEdit, 'lastedit, etc...
Maybe a better question is where to find out how umbraco maps properties to the backoffice UI. i.e. A Media File type displays 'Name' on the backoffice, but is referenced in code as 'Text'. And I can't figure out 'Created', 'Created By' either.
To answer your question, there isn't really a set way it maps those "special" properties on the Properties tab. Your best bet in the future is to look in the autocomplete if you're using VS, and ultimately the source code.
IMHO I find it really confusing why the backoffice UI and the underlying datasource (so to speak...) can't use the same verbage. I am sure I dont know umbraco well enough, but can't the UI just display 'VersionDate' instead of 'Last Edited'? (perhaps a rhetorical question!!!)
Yeah, its because Media and other APIs are pretty old and weren't always developed with a lot of consistency.
The good news is, v6 includes new APIs that are documented and use much more standards. For an example have a look at the documentation for the new Media object. You can clearly see UpdateDate, CreateDate, CreatorId, etc - and the same are in use on the Content object.
I think I just assumed you were using an older version, but if not, you can take advantage of these new APIs if you like :)
Thanks for the info Tom, Last question plz: I still didnt see how you found out 'Last Updated:' related to 'm.VersionDate'. How did you find that out? I'm assuming either VS autocomplete or the source code (what exactly did you mean by source code?) Thanks again!!
Also just noticed you're in Denver - hit me up on twitter or me at tomfulton.net if you're ever interested in grabbing a beer and talking Umbraco - we're hoping to get a group going here someday.
Media File object: How to reference 'Last edited' property
Hi all, I have this code where I can access most properties, just cant figure out 'Last Edited' property (and some others)...TIA!!!
@foreach(umbraco.cms.businesslogic.media.Media m in startMedia.GetChildMedia())
{
string fileUrl = m.getProperty("umbracoFile").Value.ToString();
string imageUrl = m.getProperty("umbracoExtension").Value.ToString();
.... misc code....
<li>
<img src=@imageUrl />
<a href=@fileUrl>@m.Text</a>
@Html.Raw(m.getProperty("description").Value)
@m.Id
</li>
I successfully access the umbracoFile, UmbracoExtension, description (a custom property), Id and Text properties. How does one reference the 'Last Edited' property associated w/ a Media object of type 'Media File'? I've tried 'LastEdited', 'LastEdit, 'lastedit, etc...
Maybe a better question is where to find out how umbraco maps properties to the backoffice UI. i.e. A Media File type displays 'Name' on the backoffice, but is referenced in code as 'Text'. And I can't figure out 'Created', 'Created By' either.
Hi Jim,
Welcome to our!
I think you can use the following:
To answer your question, there isn't really a set way it maps those "special" properties on the Properties tab. Your best bet in the future is to look in the autocomplete if you're using VS, and ultimately the source code.
Hope that helps,
Tom
Tom, u da' man! Thanks for taking a look at that.
IMHO I find it really confusing why the backoffice UI and the underlying datasource (so to speak...) can't use the same verbage. I am sure I dont know umbraco well enough, but can't the UI just display 'VersionDate' instead of 'Last Edited'? (perhaps a rhetorical question!!!)
Yeah, its because Media and other APIs are pretty old and weren't always developed with a lot of consistency.
The good news is, v6 includes new APIs that are documented and use much more standards. For an example have a look at the documentation for the new Media object. You can clearly see UpdateDate, CreateDate, CreatorId, etc - and the same are in use on the Content object.
I think I just assumed you were using an older version, but if not, you can take advantage of these new APIs if you like :)
Thanks for the info Tom, Last question plz: I still didnt see how you found out 'Last Updated:' related to 'm.VersionDate'. How did you find that out? I'm assuming either VS autocomplete or the source code (what exactly did you mean by source code?) Thanks again!!
Yeah, I took a quick look at the source of the editMedia.aspx page :)
Also just noticed you're in Denver - hit me up on twitter or me at tomfulton.net if you're ever interested in grabbing a beer and talking Umbraco - we're hoping to get a group going here someday.
Beer? Did someone say beer? Sounds good. An Umbraco users group would be cool, count me in.
Drop me an email with your info and let's get something going! me at tomfulton.net
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.