CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Thank You Letter for Contributions - Smarty Logic
Pages: [1]

Author Topic: Thank You Letter for Contributions - Smarty Logic  (Read 1233 times)

fmcooke

  • I’m new here
  • *
  • Posts: 18
  • Karma: 2
    • Beta Consulting
  • CiviCRM version: 4.3.5
  • CMS version: Joomla! 2.5.13
  • MySQL version: N/A
  • PHP version: PHP Version 5.3.10-1ubuntu3.1
Thank You Letter for Contributions - Smarty Logic
September 09, 2013, 06:43:11 pm
Hi all,

I have a small question that I can not figure out.

My use case:

1) I recorded a contribution in civicrm

2) Then I want to print a receipt, I tried to use the standard functionality but I was missing some filds I end up using Thank you letter for contribution.

3) I defined a message template with all the fields that I want to include.

4) I print the form.

This worked perfect until I wanted to include some smarty logic.  (Basically to show a text + custom field) if the custom field exist!.

My code in HTLM Source Code is something like:

<p style="text-align: right">Salta, {date.date_long}</p>

<p>{assign var=LastName value= &quot;{contribution.custom_25}&quot;} {assign var=Empty value=&#39;0&#39;} {if $LastName neq $Empty}</p>

<p>{/literal}</p>

<p>RECIBO N: {contribution.custom_25}</p>

<p>{/if}</p>


So if I print the PDF Form with the above code I receive: Server Error.

I have read some post which explained that depending on the editor you may have problems in Smart (And suggested changing the editor)

I have civicrm + joomla and I change the editor and I still have the same problem.

If I change the &quot; per " in HTML Code (And Print de PDF) the message and the logic works perfect.

My questions are:

1) Is there any way to tell smart to interpret &quot; as "?

2) How show I proceed to save the HTML code without the &quot;?

(As I can see the HTML allows to include " in example: <p style="text-align:.....)

Any help will be apreciated!,


Kind regards,
Federico















Kind Regards,
Federico Cooke

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Thank You Letter for Contributions - Smarty Logic
September 09, 2013, 07:41:22 pm

can just do it as:

Code: [Select]
<p>{assign var=LastName value= "contribution.custom_25}"} {assign var=Empty value=''} {if $LastName neq $Empty}</p>
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

fmcooke

  • I’m new here
  • *
  • Posts: 18
  • Karma: 2
    • Beta Consulting
  • CiviCRM version: 4.3.5
  • CMS version: Joomla! 2.5.13
  • MySQL version: N/A
  • PHP version: PHP Version 5.3.10-1ubuntu3.1
Re: Thank You Letter for Contributions - Smarty Logic
September 10, 2013, 11:32:13 am
Thanks Donald for your prompt replay.

I am using the expresion you mentioned. I use the HTML Code editor <p>.... but when I switch back to Plain HTML the editor converts the " in &quot; (Sorry if this part was not explained correctly). So when the user tries to send a pdf I have a server error.

(If I correct the HTML Code with " and press PDF letter the letter works fine)

How could I avoid the edito converting the " in &quot; which is not interpreted in Smarty?.


Kind regards,
Federico
Kind Regards,
Federico Cooke

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Thank You Letter for Contributions - Smarty Logic
September 10, 2013, 01:12:00 pm

u might have to disable the editor when you are doing this. Are you using jce? Might want to try using the CK editor shipped with civi and see if that works

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

fmcooke

  • I’m new here
  • *
  • Posts: 18
  • Karma: 2
    • Beta Consulting
  • CiviCRM version: 4.3.5
  • CMS version: Joomla! 2.5.13
  • MySQL version: N/A
  • PHP version: PHP Version 5.3.10-1ubuntu3.1
Re: Thank You Letter for Contributions - Smarty Logic
September 10, 2013, 01:20:46 pm
How or where should I change the Editor? In joomla? or it is configured within Civicrm? (From joomla I tried and it has no efect  :'(!.

Thanks for your help.
Kind regards,
Federico
Kind Regards,
Federico Cooke

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Thank You Letter for Contributions - Smarty Logic
September 10, 2013, 02:57:29 pm

try setting it here:

http://<site>/administrator/?option=com_civicrm&task=civicrm/admin/setting/preferences/display&reset=1

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Thank You Letter for Contributions - Smarty Logic

This forum was archived on 2017-11-26.