2

Writing as a self-answered question since it may help others...

I am adding smarty code to a mail template. Including:

{capture assign=designation}{contribution.contribution_source}{/capture}

Later in the page, I call the variable as such:

{if $designation}, for {contribution.contribution_source}{/if}

But the template breaks when I try to use it. The code looks good as far as I can tell. What's the problem?

3

The problem is that the space in the if-statement is   rather than a normal space. For this reason, it's worth writing your smarty statements while viewing the Source code in the template editor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.