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) »
  • CiviMail Templates Smarty Issue in HTML fields
Pages: [1]

Author Topic: CiviMail Templates Smarty Issue in HTML fields  (Read 644 times)

Gordon Fern

  • I’m new here
  • *
  • Posts: 3
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7
  • MySQL version: 5.5.37
  • PHP version: 5.4.29
CiviMail Templates Smarty Issue in HTML fields
July 01, 2014, 03:28:54 am
Drupal 7 site

I've hit an issue with using smarty code specifically in the html box

{"+6 weeks"|date_format:"%e %b %Y"}

If I enter this is plain text box format box it works.  Which is great, however, I really would like a little more control over the format of the emails.  So would prefer to send an HTML email.  However, if this code is entered into the HTML box.  ckEditor mutilates it to:

{"+6 weeks"|date_format:"%e %b %Y"}

Which causes Smarty to throw its toys out the pram.  Is there any workaround so that this kind of code can be used in HTML emails.  I would be more than happy to enter HTML mark up by hand rather than in a Wysiwyg editor but for obvious reasons couldn't remove Wysiwyg editing capability from the entire site to achieve this.

sibro

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7.27
  • MySQL version: 5.5
  • PHP version: 5.4
Re: CiviMail Templates Smarty Issue in HTML fields
September 20, 2014, 05:57:54 am
Gordon, I have exactly the same problem. I am running Drupal. I went through the Drupal module trying to put changes into CKeditor or change to a different editor but nothing changed. I found Civicrm uses its own CKeditor package at 4.0, How can I fix CKeditor so it will not modify the html. 
Bruce

Dan C

  • I post frequently
  • ***
  • Posts: 179
  • Karma: 17
  • CiviCRM version: All
  • CMS version: Joomla 2.5 and 3.X, Drupal 7, Wordpress 3.7 and up
  • MySQL version: 5.1.7 and up
  • PHP version: 5.3.5 and up
Re: CiviMail Templates Smarty Issue in HTML fields
September 20, 2014, 07:33:36 am
Have you tried entering the tag in the code view instead of the design view?
CrusonWeb - Web Development, Implementation, and Support.  Specializing in CiviCRM and Joomla (although also knowledgable in Wordpress and Drupal as well).

sibro

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7.27
  • MySQL version: 5.5
  • PHP version: 5.4
Re: CiviMail Templates Smarty Issue in HTML fields
September 20, 2014, 08:58:23 am
Yes, the code works correctly but when you switch to design view or save the template it changes the characters.
I found this but it only applies to 4.1 http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter. How can I upgrade the editor.
Bruce

sibro

  • I post occasionally
  • **
  • Posts: 47
  • Karma: 2
  • CiviCRM version: 4.4.5
  • CMS version: Drupal 7.27
  • MySQL version: 5.5
  • PHP version: 5.4
Re: CiviMail Templates Smarty Issue in HTML fields
September 20, 2014, 09:59:06 am
I did more digging. Found a package for CKeditor under civicrm and a setting under civicrm/admin/setting/preferences/display which controls the editor used. I was able to switch to TinyMCE but it displayed the same behavior.  Using TEXTAREA it eliminates the WYSIWYG editor and allows the proper characters to be saved. This is at best a workaround. How can I modify or upgrade an editor so it stops messing with the characters.

See bug report CRM-12796.  I am thinking it could require an upgrade to CKeditor . http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter describes the process.
« Last Edit: September 20, 2014, 10:15:01 am by sibro »
Bruce

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • CiviMail Templates Smarty Issue in HTML fields

This forum was archived on 2017-11-26.