I have Smarty enabled in settings file (on WordPress), and I am able to successfully use Smarty in Thank You letter template as long as I am using regular variables (non-arrays).
As soon as I try to create an array, I am unable to get it to work. Here are some things I have tried...
These simply display 1
<!--
{assign var="test" value=[111,222,333]}
-->
<p>{$test[2]}</p>
<!--
{assign var="test" value=[111,222,333]}
-->
<p>{$test.2}</p>
These create an error:
<!--
{assign var="test" value=['y'=>'yellow','b'=>'blue']}
-->
<p>{$test[y]}</p>
<!--
{assign var="test" value=['y'=>'yellow','b'=>'blue']}
-->
<p>{$test.y}</p>
EDIT: Just to add some more details on what I am doing... I am going to Find Contributions and then selecting All Records and then choosing Thank You Letters from the Actions drop down. I can successfully print a letter with ALL their contributions listed (each one individually), and I can successfully print a letter with a summary only Tax Deductible and/or Non Tax Deductible contributions. What I want to do is calculate a total for each Financial Type... I need to create an array in smarty in order add the total for each Financial Type seperately so I can then print a letter with a summary by Financial Type only. I am basing my solution on Iowa Boy answer from this thread: How to print USA tax receipt to individuals?
But regardless of my use case, I can not seem to get arrays in Smarty to work properly.
EDIT: So apparently Smarty v2 (currently the version used by CiviCRM) does NOT let you create or work with arrays.