2

I am sure I am missing something. I have a Civicrm template. I need to add logic to format the output like including paragraphs under certain conditions. I edit the source to add my logic like a '>' symbol, it gets converted to &GT. I am using CKEDITOR which CiviCRM provides at 4.0.1. The 4.1 version allows for preventing these conversions. I have tried upgrading the Drupal supplied CKEDITOR but could not get it working.

I do not have a problem switching to the text editor, but I have other people editing content. I also have an administrator who would bring the template up in the default editor, try to save it and brake the template. How are others handling the conversion of special characters in civi templates.

I looked at 4.5 and tried it on the demo system the conversion still occurs.

2 Answers2

2

The easiest way to upgrade your editor is to configure the editor you want in the CMS (Drupal ou Joomla) and then change the WYSIWYG Editor to "Drupal Default Editor" or "Joomla Default Editor" in Administer -> Customize data and screen -> Display preferences (civicrm/admin/setting/preferences/display?reset=1)

samuelsov
  • 395
  • 2
  • 10
  • I was unable to update the editor. One of the packages on Drupal moved ckeditor from the library to module but I could not get it together. – Bruce Sicherman Oct 20 '14 at 17:52
  • Check if the library is in sites/all/modules/ckeditor/ckeditor - read COPY_HERE.txt file. – samuelsov Oct 20 '14 at 18:22
  • samuelsov, I appreciate you helping me. In the library I have a ckeditor directory at 3.6.4. Under module there is no ckeditor directory. A package under civicrm is at 4.0.1. I tried to update on my test system but nothing worked – Bruce Sicherman Oct 20 '14 at 22:26
  • Note that I'm not quite sure you will get what you want by updating ckeditor but you can try. You shouldn't change version in CiviCRM as it will be overwritten each time you will upgrade CiviCRM. Concerning CKEditor, I can't help you more than just send you to the install doc : http://docs.cksource.com/CKEditor_for_Drupal/Open_Source – samuelsov Oct 21 '14 at 00:29
  • You may just need to change some parameters in CKEditor, like mentionned here : http://stackoverflow.com/questions/20645750/ckeditor-turn-off-html-encoding – samuelsov Oct 21 '14 at 00:42
  • Thanks, I updated ckeditor.js. I can now do logic in Smarty Thanks – Bruce Sicherman Oct 26 '14 at 13:00
  • @BruceSicherman please do click to add your support for the [CiviCRM SE site](http://area51.stackexchange.com/proposals/77367/civicrm?referrer=8gfMpihOSETXeNHrjdyxXQ2) so we can have a dedicated channel for these questions. Thanks! – Coleman Nov 09 '14 at 18:14
0

You can't add PHP code in CiviCRM template but you can add smarty code by adding the following line in your settings file :

define( 'CIVICRM_MAIL_SMARTY', 1 );

You can find an example about it in CiviCRM wiki page : Smarty in mail templates

samuelsov
  • 395
  • 2
  • 10
  • I have Smarty turned on, my issue is to it requires special characters and logic similar to php but CKeditor converts them. – Bruce Sicherman Oct 20 '14 at 11:07
  • If you need to do a > b in smarty, you can use {if a gt b}. This way, it won't be converted. See http://www.smarty.net/docsv2/fr/language.function.if.tpl for operator syntax alternative. – samuelsov Oct 20 '14 at 12:59
  • Your comment got me a little closer, The editor is changing quotes to &quot. I may be able to contrive a way without special characters but I would like to upgrade the editor. – Bruce Sicherman Oct 20 '14 at 16:22