Questions tagged [smarty]

Questions relating to CiviCRM's use of the Smarty templating syntax.

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

Install error on Wordpress with Smarty.class.php

I have installed CIVI-5.41.0 for WordPress version 5.8.1, updated all the permission as well as php version 8 but still keep getting this error. Warning: Smarty error: problem creating directory 'D:/...
0
votes
1answer
14 views

Smarty if instruction in message templates not working in single mails

I try to send single emails (Contacts > New Email) using a message template containing smarty conditional instructions in the html part of the message and in the text part of it. HTML format: <p&...
0
votes
1answer
19 views

Checksum token in system email "Memberships - Receipt (on-line)" causes critical error

When using a checksum token in a receipt email like this: http://example.org/?page=CiviCRM&q=civicrm/contribute/transact&reset=1&id=IDNUMBER&{contact.checksum}&cid={contact....
1
vote
1answer
19 views

Displaying custom contribution field in the online receipt

I am having trouble with displaying a custom contribution field on the online reciept. With the offline receipt, it works great with this: {crmAPI var='rname' entity='Contribution' action='getvalue' ...
1
vote
1answer
29 views

upper case in name with accents

{capture assign=last_name}{contact.last_name}{/capture}{$last_name|upper} I'm trying to render my contact name in uppercases with Smarty and include letters with accents. At the bottom of this page ...
1
vote
1answer
26 views

Smarty for greeting not functioning anymore on civicrm > 5.35

Is there any reason why a custom greeting using smarty wouldn't work anymore on recent versions of CiviCRM: {if "{contact.gender}"=="Femme"}Chère{ }{contact.first_name}{elseif &...
1
vote
1answer
26 views

configure URLs in system workflow messages

I've discovered that the URL that is created in the Pledge Acknowledgement and Reminder system workflow messages points to our admin site rather than the public site on our Joomla site. In other words,...
0
votes
1answer
28 views

Smarty template tokens not translating

We are running civicrm 5.33.1, wordpress 5.7, php 7.4. The following test template only translates the contact.email greeting, the others stay as they are as do all other tokens in our templates. Dear ...
2
votes
3answers
69 views

Insert file into greeting field with Smarty

When the content of the Email Greeting or the Postal Greeting field is getting too long, CiviCRM is no longer able to edit it through the GUI, what happened since I have activated Smarty and inserted ...
1
vote
1answer
27 views

Display custom contact dashboard only to certain Contact subtypes

Drupal 7.78 Civi 5.28.2 I am setting up a custom contact dashboard following Demerit's answer using UserDashBoard.extra.tpl and smarty's crmAPI. But I only want it to be for contact sub-type = Student....
1
vote
1answer
17 views

Smarty test fails in if-then-else

I have an Email greeting containing a Smarty if-then-else expression: {capture assign=language}{contact.preferred_language}{/capture}{if $language == 'fr_FR'}Bonjour{elif $language == 'nl_NL'}Hallo{...
2
votes
1answer
27 views

Activating Smarty

I'm trying to send end of year tax letters to donors. I want to customize the letters/emails with their total donation amount for the whole year. I understand I need to activate "smarty" to ...
0
votes
1answer
24 views

How to know if Smarty is really activated on WordPress?

On WP 5.6 / CiviCRM 5.32 we can't succeed to send HTML e-mails using css in <style> and {literal} (see this post) knowing that we succeed in sending html templates with in-line css. Smarty is ...
0
votes
0answers
31 views

Using smarty variables in contribution receipts sent with CiviRules

Because I want to send a receipt to our monthly donors when they signup (pre-notification) before it runs on the 1st of the month, I need to use CiviRules. The contribution is pending so Civi by ...
1
vote
2answers
35 views

Smarty contribution summary works on one site, but not another on the same server

I have burned hours on this and feel at a wall. Would appreciate some fresh eyes to shed light on new avenues of exploration. I am using "find Contributions" to generate a list of ...
0
votes
3answers
32 views

Civicrm Event Info Page has Register, iCal, and iCal feed buttons too close to each other

I'm using CiviCRM with wordpress for first time, but the same "issue" exists with Drupal. The bottom "Register Now" button on the info page for an event is very close to two more ...
1
vote
1answer
743 views

Create array in Smarty template

I want to modify the Smarty template sites/all/modules/civicrm/templates/CRM/Case/Audit/Report.tpl. I want to complement an existing foreach expression with comparing the incoming variable $group....
1
vote
2answers
98 views

PHP Fatal error: Smarty error: [in string: (...)]: syntax error: (secure mode) (...) not allowed in if statement (...)

The CiviCRM doumentation describes, how to use Smarty to customize templates for mails and pdf's: https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/#smarty E.g.: {capture ...
0
votes
1answer
16 views

How to adjust the column width of an item on a contribution receipt?

As it can be seen from screenshot below, the "QTY" column is too close to the "Donation amount" and often times it can be mistaken as "1081" instead of "108". Is there a way to adjust the column width ...
1
vote
1answer
31 views

How to include source page URL in donation page email receipt?

When my CiviContribute donation pages send out email receipts, I would like the emails to include the URL of the source page (i.e., the WordPress page that contains the shortcode of the CiviCRM ...
2
votes
1answer
38 views

failed to open stream after PHP upgrade to 7.3

Started getting this error on some Civi pages after upgrading PHP to 7.3 on server running php-fpm and nginx. Works fine after restarting php-fpm but need to restart every morning to get around ...
3
votes
1answer
38 views

Issue with CK editor <wbr> tag appearing in Token

In the CK editor, when I add a token and look at the source code, the wbr/> tags appear in the token breaking the token. I have a feeling this crept in after I enabled Smarty for email. Does anyone ...
0
votes
1answer
38 views

Unable to insert membership custom field in e-mail using Smarty

I created a custom field set and a custom field used for memberships. Now i would like to insert the data from the custom field into my e-mail template. So i tried to find the custom field id by going ...
2
votes
1answer
41 views

Thank-you letter incorrect contribution currency

My setup: CiviCRM 5.20.0 on Drupal 7. I entered contributions in different currencies. In Find Contributions, check some entries. At Actions select Thank-you letter print or email. I put tokens ...
0
votes
0answers
20 views

Smarty Variable for tax deductible

I'd like to add custom code in my contribution receipts that does the following: {if $contributionIsTaxDeductible == True} No goods or services were exchange for this donation Tax id 12-3456789 {/...
2
votes
1answer
49 views

Smarty with CiviRules

I have a template with Smarty strings. If I send the email from inside CiviCRM, Smarty works fine (it shows "Cher Guillaume"): If I send the same template using a CiviRule, it doesn't work: ...
3
votes
0answers
40 views

Adding conditional content in message template for emails, but not for PDFs

I'm wondering if it's possible to add some conditional logic in my custom user-driven message template to show some content (in this case, a footer) for messages that are sent as emails, but not to ...
1
vote
1answer
25 views

How to show paidby and check_number on Contribution - Receipt (on-line)

CiviCRM 5.16.3 on Drupal 7. I would like to show payment menthods of contribution in template Contribution - Receipt (on-line). I tried to insert $formValues.paidby or $paidby but they show nothing. (...
4
votes
1answer
65 views

Smarty only generating nulls from API calls

Using the Explorer, I built up the smarty code I need for a template to pull in address information on a contact for use in an email: {crmAPI var='result' entity='Address' action='get' contact_id=203}...
3
votes
1answer
40 views

How to suppress translation of months (or all fields) in receipts?

My platform: CiviCRM 5.16.3 on Drupal 7.6.7 PHP 7.2 CentOS 7. Drupal language is English. CiviCRM l10n installed and selected my own languange zh_TW Chinese(Taiwan). At receipt print-outs CiviCRM ...
3
votes
1answer
156 views

SMARTY error with template

I have this issue I don't understand with a civirule that should be sending an email with a .pdf attached when adding a member to a group but it's blocked by Smarty during the process of merging the ...
4
votes
1answer
44 views

Issue with sending html email from civicrm with Smarty

I am testing some templates with smarty and I don't succeed to send them when the email is - apparently - encoded in html. I could send them as normal text message. I could also send html templates ...
1
vote
2answers
179 views

How to use Smarty for change greetings for French?

I need to adapt Greetings in order to fit to French (which has a feminine and masculine for "Dear"). I read on the forum that I should use Smarty and read the short documentation (CiviCRM ...
1
vote
2answers
56 views

How to include smarty script with mosaico email

I used to use a name personalisation in civimail with smarty script... {capture assign=nickname}{contact.nick_name}{/capture} Dear {if $nickname}{contact.nick_name}{else}{contact.sort_name}{/if} I ...
1
vote
1answer
57 views

How to use Contact name if nickname is not present in bulk mail?

I need to send an email with Nickname as first preference, if that not present then use Contact name. Cant figure out what token to use? I have tried this but seems not rendering correctly in email: ...
1
vote
0answers
59 views

Smarty does not display database fields

As a workflow message for a contribution confirmation, i use the following template. All values are displayed, except $financial_type_id and $source. Both stay empty in the output table. How come only ...
3
votes
2answers
143 views

Smarty and Mosaico - compatibility?

Seeing a lot of smarty errors in Drupal log file for mailings using Mosaico template - looks like an error for every message sent so thousands filling log files. Nothing obvious in Mosaico template ...
3
votes
1answer
48 views

How to set a id attribute to button?

I am creating a button using php pear. Button (php code) $this->addButtons(array( /** * Array for 'next' button */ array( 'type' => 'next', 'name' => E::ts('Next'), ...
1
vote
0answers
39 views

I am adding crmButton in the template for EventInfo.tpl , how can I add drupal callback function and makesure it does not breaks as is the case here?

{crmButton p='drupal/event-workflow/$uid/$gid' q="action=browse&reset=1&gid=$gid" icon="th-list"}{ts}Request for Approval{/ts}{/crmButton} Where I have defined $uid and $gid variables in ...
2
votes
0answers
192 views

What does undefined extension class 'Smarty_Internal_Method_Assign_By_Ref' Mean?

The new installation of CIVI works. LAMP server, shared hosting, PHP 7.2, Joomla! 3.9, etc. When I click to go to configuration checklist, I get the error: undefined extension class '...
0
votes
1answer
24 views

Extend templates through the hook file

I have configured the "Custom" folders for templates and PHP following https://docs.civicrm.org/dev/en/latest/framework/templates/extending-smarty/ I created this hook file (and I'm sure it's ...
1
vote
1answer
192 views

Custom date field formatting with smarty

I'm trying to format a custom date field using smarty to send emails. What I want is to have the day of the week included, as "Wednesday, April 18, 2018". It seems that this should work: {contact....
2
votes
2answers
95 views

Search Custom Template Directory first when using Smarty {include}

I'm sure this is easy but the answer has escaped me. On a drupal install CiviCRM is installed at: /webtree/mysite/htdocs/sites/www.mysite/modules/civicrm I have a Custom Template File directory set ...
0
votes
1answer
306 views

Problems getting smarty to work

I'm not sure where to look - I've tried everything that I can think of to get smarty to work in an email template, but it's just not happening. I'm using CiviCRM 4.7.27 with WordPress 4.9.3. I've ...
2
votes
2answers
231 views

How to check if a contact has an active membership in a smarty template?

Is there a variable that one can use in smarty in a message template to simply determine if a contact has an active membership?
1
vote
3answers
418 views

Show translated string in a template field (using smarty?)

I'm using a custom profile template. I need display different text strings depending on browser language of user... One string for Spanish users and other string for all other users. It seems this ...
2
votes
1answer
158 views

How to deal with ' or (&#39;) in CKeditor

I am unable to use smarty in CKeditor because it's transforming the ' into & #39; I couldn't find anything useful when click the configure CKEditor Button in display preferences.
1
vote
1answer
77 views

Displaying Transaction Id in Thank you letter

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 ...
1
vote
1answer
37 views

Smarty causing contact import to fail

I have CiviCRM 4.6.28 on Drupal 7.56, hosted on Pantheon. We are trying to import lists of contacts, but anything above 250 contacts throws a timeout error, due to Pantheon's time limits. The time ...
0
votes
1answer
130 views

How to debug Smarty mail template codes, broken after upgrade

I have a few Mail Templates that have conditional smarty codes like: {capture assign=pp_scan}{contact.custom_74}{/capture}{if $pp_scan}You have already provided{else}You have not yet provided{/if} a ...