title: Sitecore: Find the value of a field for a selected Item
body: <p>I'm trying to create some custom code inside my Sub Layout.</p>
  
  <p>I have to build a newsletter, the newsletter can be composed on a number of article.
  An article can be composed by a title / Sub title / Header and image.</p>
  
  <p>Can be, because the Sub title or the image are not mandatory.
  To avoid any empty space / missing image in the newsletter email, I would like to create a specific HTML based on the content.</p>
  
  <p>If there is no image, don't show the Image control, if there is no Sub title, don't show the Sub Title control;</p>
  
  <p>To do that, I'm using the following code which is not working :(</p>
  
  <pre><code>    Sitecore.Data.Database master = Sitecore.Configuration.Factory.GetDatabase("master");
  Sitecore.Data.Items.Item home = master.GetItem("/sitecore/content/Home");
  
  if(home != null &amp;&amp; home.Fields != null)
  {
  string name = home.Fields["Image"].Name; -&gt; Which Fields["Image"] returns null.
  }
  </code></pre>
  
  <p>Is there another way to retreive the field of the selected article ? As my code is not working at all, I don't understand how to retreive the Field value of my selected Item.</p>
  
  <p>Thank you.</p>