Answers.Body: <p>Giving the enduser the ability to include scripts is risky way to present social media links. Any errors could protentialy break the entire html page / site If you really want to do it this way you can use <a href="http://twig.sensiolabs.org/doc/filters/raw.html" rel="nofollow">twig's raw filter</a> </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-17T18:43:00.910Z
Answers.Text: That works perfectly, thanks! Fortunately, in my case, there is only one "end user." I would never implement something like that on site where the content of that field couldn't be controlled.
Answers.UserDisplayName: Philip Jones
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-17T18:17:54.090Z
Answers.LastActivityDate: 2016-10-17T18:17:54.090Z
Answers.UserDisplayName: Moto_Nomad
Body: <p>I am building a section in which a client will list their various social network connections. There are fields for each social network's name and icon, as well as a field with the URL to the client's page on the specified network.</p>
  
  <p>I also need a field that contains the code needed for each network's "Share" button. The code for "Share" buttons varies, but typically includes some HTML as well as <code>&lt;script&gt;</code> tags. When I output this field in a template, its contents are HTML encoded and displayed literally.</p>
  
  <p>How can I keep this from being encoded so the HTML and Javascript can be parsed by the browser?</p>
  
Tags: <javascript>
Title: HTML and Scripts in Entries?
ThreadText: # HTML and Scripts in Entries?
  
  (Asked by: username_0 on 2016-10-17)
  
  I am building a section in which a client will list their various social network connections. There are fields for each social network's name and icon, as well as a field with the URL to the client's page on the specified network.
  
  I also need a field that contains the code needed for each network's "Share" button. The code for "Share" buttons varies, but typically includes some HTML as well as `<script>` tags. When I output this field in a template, its contents are HTML encoded and displayed literally.
  
  How can I keep this from being encoded so the HTML and Javascript can be parsed by the browser?
  
  **Tags:** javascript
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-10-17. Score: 3 | Accepted answer
  
  Giving the enduser the ability to include scripts is risky way to present social media links. Any errors could protentialy break the entire html page / site If you really want to do it this way you can use [twig's raw filter](http://twig.sensiolabs.org/doc/filters/raw.html)
  
  > **Comments:**
  > **username_0**: That works perfectly, thanks! Fortunately, in my case, there is only one "end user." I would never implement something like that on site where the content of that field couldn't be controlled.  
  
  ---
  
  