Answers.Body: <p>I fixed this by adding (as @Andrei suggested) <code>config.entities = false;</code> to my config.js file in the ckeditor (/your/path/to/civicrm/civicrm/packages/ckeditor/config.js).</p>
  
  <p>Just don't forget: If you are modifying config.js you should first have configured a Custom PHP Path under Administer > System Settings > Directories, and place your modified version in the custom path.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-01-19T17:18:41.430Z
Answers.LastActivityDate: 2016-01-19T17:18:41.430Z
Answers.UserDisplayName: RayWright
Body: <p>I'm writing an if statement for a mailing and keep coming across a parse error. My statement is pretty straightforward:</p>
  
  <pre><code>{if contribution.non_deductible_amount eq '0'} NA {else} {contribution.non_deductible_amount}{/if}
  </code></pre>
  
  <p>I've tried a few variations equals signs,double quotes, etc. But each time it adds an ampersand which causes the parse error:</p>
  
  <pre><code>&lt;?php if ($this-&gt;_tpl_vars['contribution']['non_deductible_amount'] == &amp; #39;0&amp;#39;): ?&gt; NA &lt;?php else: ?&gt; Amount Here&lt;?php endif; ?&gt;
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-15T03:02:41.337Z
Comments.Text: I think &#39 is a single quote.  I had a similar problem and tried all sorts of things.  In the end, I had to put double quotes about both sides of the eq.  So  try {if "contribution.non_deductible_amount" eq "0"}
Comments.UserDisplayName: Paul-Tahoe
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-15T15:20:16.350Z
Comments.Text: Not sure if I misunderstand you but I believe you are editing the template with a wyswig editor (CKEditor?) if that's the case you'll have to tell CKEditor not to convert the quotes  characters into HTML entities. Try adding `config.entities = false;` to `/your/path/to/civicrm/civicrm/packages/ckeditor/config.js`
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-15T18:48:57.113Z
Comments.Text: Thanks Paul-Tahoe I gave that a go, no dice. @Andrei Yes, I am using the wyswig (CKEditor). I tried adding your suggestion in the config file and no dice. Your suggestion makes total sense but it still appears to be converting the characters. Perhaps there is another spot that is causing it to encode the characters. I'll poke around but if you have any thoughts - I'm all ears!
Comments.UserDisplayName: RayWright
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-15T19:05:13.833Z
Comments.Text: How about adding also `config.htmlEncodeOutput = false;` (I haven't tried it) also try clearing browser's cache after applying the changes
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-15T19:11:17.037Z
Comments.Text: I actually went web surfing and added that one before you suggested it. Browser cache didn't help, I'm leaning toward another file controlling something because I also tried removing a command in the config file that removes some of the standard buttons i.e.Underline Subscript and it didn't seem to have any affect.
Comments.UserDisplayName: RayWright
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-15T20:03:20.563Z
Comments.Text: What Civi version are you using and what CMS, it's always helpful to add those details to your question. I'm a Wordpress user but I know there's a "_Use Drupal/Joomla default editor_" option (which has been removed in Civi 4.7)
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-15T21:14:59.417Z
Comments.Text: Whoops, I usually remember that, I'm  in Wordpress 4.3.2 and Civi 4.6.4.
Comments.UserDisplayName: RayWright
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-19T16:40:35.720Z
Comments.Text: Any improvements? I'm sorry to tell you that I don't know what else could be, I have `config.entities= false;` in config.js file and it works for me, perhaps someone else has more insights on this.
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-01-19T17:16:31.043Z
Comments.Text: I just got back to working on that and you were correct the first time. I had failed (doh!) to put the updated config file in my custom-php folder. It works now, thank you!
Comments.UserDisplayName: RayWright
Tags: <message-templates>
Title: Conditional Statement in mailing causes parse error
ThreadText: # Conditional Statement in mailing causes parse error
  
  (Asked by: username_0 on 2016-01-15)
  
  I'm writing an if statement for a mailing and keep coming across a parse error. My statement is pretty straightforward:
  
  ```
  {if contribution.non_deductible_amount eq '0'} NA {else} {contribution.non_deductible_amount}{/if}
  
  ```
  
  I've tried a few variations equals signs,double quotes, etc. But each time it adds an ampersand which causes the parse error:
  
  ```
  <?php if ($this->_tpl_vars['contribution']['non_deductible_amount'] == & #39;0&#39;): ?> NA <?php else: ?> Amount Here<?php endif; ?>
  
  ```
  
  **Tags:** message-templates
  
  > **Comments:**
  > **username_1**: I think &#39 is a single quote.  I had a similar problem and tried all sorts of things.  In the end, I had to put double quotes about both sides of the eq.  So  try {if "contribution.non_deductible_amount" eq "0"}  
  > **username_2**: Not sure if I misunderstand you but I believe you are editing the template with a wyswig editor (CKEditor?) if that's the case you'll have to tell CKEditor not to convert the quotes  characters into HTML entities. Try adding `config.entities = false;` to `/your/path/to/civicrm/civicrm/packages/ckeditor/config.js`  
  > **username_0**: Thanks username_1 I gave that a go, no dice. @username_2 Yes, I am using the wyswig (CKEditor). I tried adding your suggestion in the config file and no dice. Your suggestion makes total sense but it still appears to be converting the characters. Perhaps there is another spot that is causing it to encode the characters. I'll poke around but if you have any thoughts - I'm all ears!  
  > **username_2**: How about adding also `config.htmlEncodeOutput = false;` (I haven't tried it) also try clearing browser's cache after applying the changes  
  > **username_0**: I actually went web surfing and added that one before you suggested it. Browser cache didn't help, I'm leaning toward another file controlling something because I also tried removing a command in the config file that removes some of the standard buttons i.e.Underline Subscript and it didn't seem to have any affect.  
  > **username_2**: What Civi version are you using and what CMS, it's always helpful to add those details to your question. I'm a Wordpress user but I know there's a "_Use Drupal/Joomla default editor_" option (which has been removed in Civi 4.7)  
  > **username_0**: Whoops, I usually remember that, I'm  in Wordpress 4.3.2 and Civi 4.6.4.  
  > **username_2**: Any improvements? I'm sorry to tell you that I don't know what else could be, I have `config.entities= false;` in config.js file and it works for me, perhaps someone else has more insights on this.  
  > **username_0**: I just got back to working on that and you were correct the first time. I had failed (doh!) to put the updated config file in my custom-php folder. It works now, thank you!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2016-01-19. Score: 1 | Accepted answer
  
  I fixed this by adding (as @username_2 suggested) `config.entities = false;` to my config.js file in the ckeditor (/your/path/to/civicrm/civicrm/packages/ckeditor/config.js).
  
  Just don't forget: If you are modifying config.js you should first have configured a Custom PHP Path under Administer > System Settings > Directories, and place your modified version in the custom path.
  
  
  ---
  
  