Answers.Body: <p>If you change the entry type then you're going to lose content for sure.</p>
  
  <p>If changing that field type to an entry is really what you want, great. You could do something like</p>
  
  <pre><code>{# grab the first entry that we've selected #}
  {% set learnMoreLink = box.learnMoreLink.first() %}
  {# spit out the url for the first entry #}
  &lt;a href="{{ learnMoreLink.url }}"&gt;{{ box.learnMoreText }}&lt;/a&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-17T17:55:55.880Z
Answers.Text: Hey, thanks for replying.
  
  I replaced "<a href="{{box.learnMoreLink}}"> {{ box.learnMoreText }} </a>" with your code snippet and it didn't work. The content is still getting lost.
Answers.UserDisplayName: user6999
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-17T20:39:43.850Z
Answers.Text: Have you actually defined the relationship after changing the field type?
Answers.UserDisplayName: Steven Grant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-17T21:27:31.647Z
Answers.Text: I am not totally sure what you mean by 'defining the relationship'. Could you please elaborate? Sorry, I am new to craft.
  
  All I did was change the field type from 'plain text' to 'entry' in the CMS and then replaced my <a> tag code with your snippet.
Answers.UserDisplayName: user6999
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-17T21:47:21.253Z
Answers.Text: So if you've only changed it from plain text to entry, you're only part way there, next you'll need to edit the entry and then select the entry that you want the button to link to, save that entry and then the code above should work. Plain text and entry store entirely different things in the database. It won't auto transform.
Answers.UserDisplayName: Steven Grant
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-14T06:54:27.313Z
Answers.LastActivityDate: 2017-07-14T06:54:27.313Z
Answers.UserDisplayName: Steven Grant
Body: <pre><code>&lt;a href="{{box.learnMoreLink}}"&gt; {{ box.learnMoreText }} &lt;/a&gt; 
  </code></pre>
  
  <p>Currently I have a Matrix field that has two plain-text fields. I want to change the href (<code>{{box.learnMoreLink}}</code>) from plain-text to an entry. I am trying to figure out how to render the entry field. Just changing the field type in the CMS is resulting in content loss. Anyone know the best way to go about this?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-13T22:53:36.820Z
Comments.Text: Can you explain why you want to change to an entry field? Is there a link field on the entry field you want to use instead?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-07-17T21:33:44.227Z
Comments.Text: I want to change it to an entry field to make the url dynamic. I tried setting up {{siteUrl}} but that didn't work.
Comments.UserDisplayName: user6999
Tags: <templating><matrix><entry><entry-type><entries-field>
Title: How to render an entry type of a Matrix in HTML?
ThreadText: # How to render an entry type of a Matrix in HTML?
  
  (Asked by: username_0 on 2017-07-13)
  
  ```
  <a href="{{box.learnMoreLink}}"> {{ box.learnMoreText }} </a> 
  
  ```
  
  Currently I have a Matrix field that has two plain-text fields. I want to change the href (`{{box.learnMoreLink}}`) from plain-text to an entry. I am trying to figure out how to render the entry field. Just changing the field type in the CMS is resulting in content loss. Anyone know the best way to go about this?
  
  **Tags:** templating, matrix, entry, entry-type, entries-field
  
  > **Comments:**
  > **username_1**: Can you explain why you want to change to an entry field? Is there a link field on the entry field you want to use instead?  
  > **username_0**: I want to change it to an entry field to make the url dynamic. I tried setting up {{siteUrl}} but that didn't work.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-07-14. Score: 1 | Accepted answer
  
  If you change the entry type then you're going to lose content for sure.
  
  If changing that field type to an entry is really what you want, great. You could do something like
  
  ```
  {# grab the first entry that we've selected #}
  {% set learnMoreLink = box.learnMoreLink.first() %}
  {# spit out the url for the first entry #}
  <a href="{{ learnMoreLink.url }}">{{ box.learnMoreText }}</a>
  
  ```
  
  > **Comments:**
  > **username_0**: Hey, thanks for replying.  I replaced "<a href="{{box.learnMoreLink}}"> {{ box.learnMoreText }} </a>" with your code snippet and it didn't work. The content is still getting lost.  
  > **username_2**: Have you actually defined the relationship after changing the field type?  
  > **username_0**: I am not totally sure what you mean by 'defining the relationship'. Could you please elaborate? Sorry, I am new to craft.  All I did was change the field type from 'plain text' to 'entry' in the CMS and then replaced my <a> tag code with your snippet.  
  > **username_2**: So if you've only changed it from plain text to entry, you're only part way there, next you'll need to edit the entry and then select the entry that you want the button to link to, save that entry and then the code above should work. Plain text and entry store entirely different things in the database. It won't auto transform.  
  
  ---
  
  