How to get media url by property alias?

Hello everybody, i’m very new to Umbraco, and you’ll soon know why. Here’s my dilemma:

  1. I’m creating an Umbraco with multiple sites
  2. I want to build a Document Type I can use EVERYWHERE
  3. I need to be able to get a media URL from that document type by a property ALIAS name, not a media ID because I need to use this code EVERYWHERE

As far as I understand, I get the media id after i create an instance of that document type within the properties tab, and each instance is a different media id. Am I correct?

so the question: How to get media url by property alias? like this:

var url - umbraco.GetMedia(“backgroundImage”).Url;

Please help!! or, point me to some good reading to I can figure it out myself.

Thanks.


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/70725-how-to-get-media-url-by-property-alias