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 CiviMail (Moderator: Piotr Szotkowski) »
  • Line feeds in Message Template Addresses
Pages: [1]

Author Topic: Line feeds in Message Template Addresses  (Read 416 times)

lesterhv

  • I’m new here
  • *
  • Posts: 1
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Line feeds in Message Template Addresses
February 27, 2014, 11:56:22 am
Some of our contacts use the supplementary address field and we would like this to show up in the mailing address.

The problem is how to include that extra line feed into the if statement.

So far we have:
Code: [Select]
{$smarty.now|date_format}

{contact.first_name}{ }{contact.last_name}
{contact.address_name}{ }{contact.organization_name}
{contact.street_address}{}{if contact.supplemental_address_1}{"\n"}{contact.supplemental_address_1}{else}{} {/if}
{contact.city}, {contact.state_province} {contact.postal_code}

I have tried many combinations of strings to force the line break from searching the web but all either seem to be rendered literally or ignored.

Thanks for any help you can give.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Line feeds in Message Template Addresses
February 27, 2014, 01:35:17 pm
We use a token to put in the mailing block based on the mailing labels https://github.com/eileenmcnaughton/tokens/blob/master/address.inc - it doesn't seem to include extra lines.

To make it work you need to install this civitoken module https://github.com/eileenmcnaughton/civitoken & then put a folder 'tokens' into your custom php directory (configured under administer/system settings/directories) & put the above file into that tokens folder.

It's a little unwieldly to set up - but I haven't had reason to revisit it
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Line feeds in Message Template Addresses

This forum was archived on 2017-11-26.