title: Sitefinity Custom Fields for list widgets and how to use them in MVC view templates
body: <p>I've added a Custom Field to the List Widget in Sitefinity 8.1, it's <strong>Type</strong> is <strong>Related data</strong> and it's <strong>Data type</strong> is <strong>Pages</strong>. The field name is <strong>LinkedPageUrl</strong>.</p>
  
  <p>Works perfectly in the back end allowing me to select a page from system and store it against that particular List Item. </p>
  
  <p>I can't find any place in Sitefinity's documentation that explains how I would programmatically use this field in a MVC based <strong>List.SimpleList.cshtml</strong> view template that I'm customizing. </p>
  
  <p>I've seen this being used in the News widget where there is an associated Image for each News Article:  </p>
  
  <pre><code>&lt;img src="@Html.Raw(item.Fields.RelatedImg.Fields.MediaUrl)" class="img-responsive" /&gt;
  </code></pre>
  
  <p>But I don't get close to this because I don't have the slightest idea where to begin... What's the model structure, syntax, etc. </p>
  
  <p>My objective is to change each list item rendered out into an anchor and the anchor should make use of this Related Data field's URL for it's Href property.</p>
  
  <p><strong>EDIT:</strong><br>
  <a href="https://i.stack.imgur.com/BZI9C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BZI9C.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/5jy10.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5jy10.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/djiBG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/djiBG.png" alt="enter image description here"></a></p>