Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-12969

Smarty condition | $var should behave like '{var}'

    Details

    • Type: Improvement
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 4.3.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      If I use a Smarty-condition in standard form (as described at http://www.smarty.net/docs/en/language.function.if.tpl) while I don't use the variable elsewhere, the condition doesn't work.

      Example (broken because $contact.gender isn't used):
      Liebe

      {if $contact.gender eq 'Mann'}

      r

      {elseif $contact.gender neq 'Frau'}

      /r

      {/if} {contact.first_name}

      Example (workaround):
      Liebe{if '{contact.gender}' eq 'Mann'}r {elseif '{contact.gender}' neq 'Frau'}/r{/if}

      {contact.first_name}

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mielert Fritz Mielert
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: