Answers.Body: <p>It was hard to finish reading all of your post due to the sirens that go off in my head whenever someone talks about disabling security settings.</p>
  
  <p>Nevertheless, is there really something here that you can't do with a token or a hook? Please could you describe your use case a bit more?</p>
  
  <p>In general, the update safe way is to overwrite core files in a custom templates extension - put it in sites/default/files/civicrm, next to extensions. (That path assumes Drupal, it'll be different in Joomla. You will need to update your resources folder in the Administer menu.</p>
  
  <p>Once you've done that make sure to replicate the folder path in the templates folder. You will likely need to update this file on each CiviCRM update as part of the update procedure (if it changes in core that is).</p>
  
  <p>Good luck!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-10T14:57:26.257Z
Answers.LastActivityDate: 2016-03-10T14:57:26.257Z
Answers.UserDisplayName: JohnFF
Body: <p>I'm using CiviCRM 4.6.14 and I want to write a Template for CiviMail using the smarty templating engine. <br />
  I need to add some PHP code to that template, but obvious the security setting is set to true for CiviMail so I get errors. <br />
  My temporary solution is to change the settings in the file "Smarty.class.php", but that file will be overwritten at the next update.<br />
  So is there a way, to disable the security setting in the template or any other update safe way, to disable that setting?</p>
  
  <p>Thanx in advance</p>
  
Tags: <civimail><security><smarty>
Title: Is there an update safe way to disable smarty security in templates for CiviMail?
ThreadText: # Is there an update safe way to disable smarty security in templates for CiviMail?
  
  (Asked by: username_0 on 2016-03-10)
  
  I'm using CiviCRM 4.6.14 and I want to write a Template for CiviMail using the smarty templating engine.   
  I need to add some PHP code to that template, but obvious the security setting is set to true for CiviMail so I get errors.   
  My temporary solution is to change the settings in the file "Smarty.class.php", but that file will be overwritten at the next update.  
  So is there a way, to disable the security setting in the template or any other update safe way, to disable that setting?
  
  Thanx in advance
  
  **Tags:** civimail, security, smarty
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-03-10. Score: 1
  
  It was hard to finish reading all of your post due to the sirens that go off in my head whenever someone talks about disabling security settings.
  
  Nevertheless, is there really something here that you can't do with a token or a hook? Please could you describe your use case a bit more?
  
  In general, the update safe way is to overwrite core files in a custom templates extension - put it in sites/default/files/civicrm, next to extensions. (That path assumes Drupal, it'll be different in Joomla. You will need to update your resources folder in the Administer menu.
  
  Once you've done that make sure to replicate the folder path in the templates folder. You will likely need to update this file on each CiviCRM update as part of the update procedure (if it changes in core that is).
  
  Good luck!
  
  
  ---
  
  