Answers.Body: <p>This is a known bug and is documented and fixed at <a href="https://issues.civicrm.org/jira/browse/CRM-21690" rel="nofollow noreferrer">CRM-21690</a>.  You will need to apply the <a href="https://github.com/civicrm/civicrm-core/pull/11570/files" rel="nofollow noreferrer">patch</a> to fix the problem or will need to wait for 4.7.30 release.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-25T04:57:52.063Z
Answers.Text: I tested your patch on 4.7.25. It seems to fix the alignment of the transaction ID. However when I use the code snippet in CRM-21690, the thank you letter is not made and I get this error (even after I cleared templates_c)
  Parse error: syntax error, unexpected '&' in /srv/bindings/86e9cd092c1243e3a9ebfab3cf193a7e/files/private/civicrm/templates_c/en_US/%%63/634/6343E86A%%table%3E.php on line 36
Answers.UserDisplayName: Yossi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-25T05:21:44.940Z
Answers.Text: Can you please check the html message you using if it has any such chars. This error usually occurs if smarty fails to read the template or html.
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-25T06:28:48.517Z
Answers.Text: you are right. The ckeditor transformed "" into its code version which included a &. Looks like the patch works!
Answers.UserDisplayName: Yossi
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-25T10:51:16.657Z
Answers.Text: So can this question be closed as answered??
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-22T10:00:20.973Z
Answers.LastActivityDate: 2018-01-22T10:00:20.973Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I am trying to create thank you letters grouping the transactions by contact. 
  I am creating a table to display the contribution information but I am running into a problem with Transaction ID. since not every contribution has one, it doesn't align properly in the table. I tried using the 'line break' and 'verticle table cell' but the <br /> or  is not printing for when the token is empty. </p>
  
  <p>I tried to work around it by printing N/A when if the token is empty but I can't seem to get this working either 
  {capture assign=temp}{contribution.trxn_id}{/capture}{if $temp ne ""}{$temp}{else}N/A{/if} </p>
  
  <p><a href="https://i.sstatic.net/iAfTG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/iAfTG.png" alt="enter image description here"></a></p>
  
  <p>UPDATE: I tried @RayWright's suggestion and it worked for individual thank you letters perfectly. However, when grouping the contribution records by contact, the same code will only print the transaction ID when there is one and will not print NA when there isn't one...</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-22T16:07:23.213Z
Comments.Text: Any chance this post is helpful? https://civicrm.stackexchange.com/questions/21118/smarty-code-not-working/21119#21119
Comments.UserDisplayName: RayWright
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-22T22:01:59.430Z
Comments.Text: Thanks @RayWright, that solved it for individual thank you letters however it still won't work for grouped-by-contact thank you letters
Comments.UserDisplayName: Yossi
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-27T13:43:28.333Z
Comments.Text: @Yossi have you had a look at this related [question/answer](https://civicrm.stackexchange.com/q/9131/872)
Comments.UserDisplayName: Andrei
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-28T02:48:14.330Z
Comments.Text: @Andrei Thank you for bringing that to my attention. It seems like the solution I am looking for but I have been trying for 1.5 hours to apply the same code for transaction id and I've not been successful yet. I don't know whether I am getting the variables wrong or if maybe the logic is different for trnx_id. Any ideas?
Comments.UserDisplayName: Yossi
Tags: <tokens><smarty><pdf>
Title: Displaying Transaction Id in Thank you letter
ThreadText: # Displaying Transaction Id in Thank you letter
  
  (Asked by: username_0 on 2017-12-21)
  
  I am trying to create thank you letters grouping the transactions by contact.
  I am creating a table to display the contribution information but I am running into a problem with Transaction ID. since not every contribution has one, it doesn't align properly in the table. I tried using the 'line break' and 'verticle table cell' but the   
   or is not printing for when the token is empty.
  
  I tried to work around it by printing N/A when if the token is empty but I can't seem to get this working either
  {capture assign=temp}{contribution.trxn\_id}{/capture}{if $temp ne ""}{$temp}{else}N/A{/if}
  
  [![enter image description here](https://i.sstatic.net/iAfTG.png)](https://i.sstatic.net/iAfTG.png)
  
  UPDATE: I tried @username_1's suggestion and it worked for individual thank you letters perfectly. However, when grouping the contribution records by contact, the same code will only print the transaction ID when there is one and will not print NA when there isn't one...
  
  **Tags:** tokens, smarty, pdf
  
  > **Comments:**
  > **username_1**: Any chance this post is helpful? https://civicrm.stackexchange.com/questions/21118/smarty-code-not-working/21119#21119  
  > **username_0**: Thanks @username_1, that solved it for individual thank you letters however it still won't work for grouped-by-contact thank you letters  
  > **username_2**: @username_0 have you had a look at this related [question/answer](https://civicrm.stackexchange.com/q/9131/872)  
  > **username_0**: @username_2 Thank you for bringing that to my attention. It seems like the solution I am looking for but I have been trying for 1.5 hours to apply the same code for transaction id and I've not been successful yet. I don't know whether I am getting the variables wrong or if maybe the logic is different for trnx_id. Any ideas?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2018-01-22. Score: 1 | Accepted answer
  
  This is a known bug and is documented and fixed at [CRM-21690](https://issues.civicrm.org/jira/browse/CRM-21690). You will need to apply the [patch](https://github.com/civicrm/civicrm-core/pull/11570/files) to fix the problem or will need to wait for 4.7.30 release.
  
  > **Comments:**
  > **username_0**: I tested your patch on 4.7.25. It seems to fix the alignment of the transaction ID. However when I use the code snippet in CRM-21690, the thank you letter is not made and I get this error (even after I cleared templates_c) Parse error: syntax error, unexpected '&' in /srv/bindings/86e9cd092c1243e3a9ebfab3cf193a7e/files/private/civicrm/templates_c/en_US/%%63/634/6343E86A%%table%3E.php on line 36  
  > **username_3**: Can you please check the html message you using if it has any such chars. This error usually occurs if smarty fails to read the template or html.  
  > **username_0**: you are right. The ckeditor transformed "" into its code version which included a &. Looks like the patch works!  
  > **username_3**: So can this question be closed as answered??  
  
  ---
  
  