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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Translating line breaks into HTML in profile
Pages: [1]

Author Topic: Translating line breaks into HTML in profile  (Read 407 times)

JohnFF

  • I post frequently
  • ***
  • Posts: 235
  • Karma: 6
  • CiviCRM version: 4.4.13
  • CMS version: Drupal 7.28
  • MySQL version: 5.5.31-1
  • PHP version: 5.3.27
Translating line breaks into HTML in profile
July 14, 2014, 07:15:28 am
Hi CiviForumers,

I'd like to translate line breaks in a field into HTML tags.

The PHP part isn't the problem, the problem is figuring out which form hook it should go in! Obviously postProcess is too late (by then the form is submitted) and alterContent is when the form is loaded, not submitted.

Any ideas other than happy-go-hackily re-inserting the data *again* in the postProcess hook after it has been inserted the first time?

Thanks,

John
If you like empowering charities in a free and open way, then you're going to love Civi.

Email Amender: https://civicrm.org/extensions/email-amender
UK Phone Validator: https://civicrm.org/extensions/uk-phone-number-validator
http://civifirst.com
https://twitter.com/civifirst

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Translating line breaks into HTML in profile
July 14, 2014, 03:38:38 pm
http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_buildForm might work, but I've never tried modifying field content that way.

It might make sense to treat this as an after-the-fact cleanup (like you do with phone-numbers). You could trigger the cleanup during postProcess (or during installation/upgrade/etc).

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Translating line breaks into HTML in profile

This forum was archived on 2017-11-26.