Answers.Body: <p>So we looked at how one of the existing CKEditor-enabled fields on the page was processed in the civi code base (we chose the <code>footer_text</code> slightly further up the Online Registration page) and tried to replicate the same processing with the confirm_email_text field.</p>
  
  <p>Based on this, we changed two files.</p>
  
  <p><b>1. civicrm/CRM/Core/I18n/SchemaStructure.php</b></p>
  
  <p>In the original Civi code on our version this had the following settings for confirm_email_text: </p>
  
  <pre><code>      'confirm_email_text' =&gt; array(
          'type' =&gt; "TextArea",
          'rows' =&gt; "4",
          'cols' =&gt; "50",
        ) ,
  </code></pre>
  
  <p>We changed this (it was around line 644) to:</p>
  
  <pre><code>      'confirm_email_text' =&gt; array(
          'type' =&gt; "RichTextEditor",
          'rows' =&gt; "4",
          'cols' =&gt; "50",
        ) ,
  </code></pre>
  
  <p>In other words, we changed the type from 'TextArea' to 'RichTextEditor'.</p>
  
  <p><b>2. civicrm/CRM/Event/Form/ManageEvent/Registration.php</b></p>
  
  <p>In the original Civi code on our version this had the following settings for confirm_email_text:</p>
  
  <pre><code>$form-&gt;add('textarea', 'confirm_email_text', ts('Text'), $attributes['confirm_email_text']);
  </code></pre>
  
  <p>We changed this (it was around line 423) to:</p>
  
  <pre><code>$form-&gt;add('wysiwyg', 'confirm_email_text', ts('Text'), $attributes['confirm_email_text']);
  </code></pre>
  
  <p>In other words, we changed the first argument from 'textarea' to 'wysiwyg'.</p>
  
  <p><b>One more note</b></p>
  
  <p>This code sufficed to display the CKEditor instead of the default textarea, and to save and retrieve the text that was written into it. However, during testing we found that our emails were not displaying images that had a <code>src</code> with a % sign in it properly. This was remedied by altering our Message Templates. They had the following line in them by default for including the custom confirmation text at the top of the confirmation email:</p>
  
  <pre><code>{$event.confirm_email_text|htmlize}
  </code></pre>
  
  <p>We simply removed the htmlize filter, so instead we had:</p>
  
  <pre><code>{$event.confirm_email_text}
  </code></pre>
  
  <p>This seemed to deal with the problem.</p>
  
  <p>I should note that we removed the line of code mentioned in my original question from Registration.tpl before implementing the actual working solution above.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-30T16:23:33.687Z
Answers.LastActivityDate: 2017-03-30T16:29:28.713Z
Answers.LastEditDate: 2017-03-30T16:29:28.713Z
Answers.UserDisplayName: William Gordon
Body: <p>I am referring in particular to the textarea that allows one to write a custom confirmation email in the 'Online Registration' tab of an event's configuration page.</p>
  
  <p>Following the CKEditor integration documentation here (<a href="http://docs.ckeditor.com/#!/guide/dev_installation-section-adding-ckeditor-to-your-page" rel="nofollow noreferrer">http://docs.ckeditor.com/#!/guide/dev_installation-section-adding-ckeditor-to-your-page</a>), I have added some JavaScript to the bottom of templates/CRM/Event/Form/ManageEvent/Registration.tpl to allow the CKEditor user interface to take over the textarea (where <code>confirm_email_text</code> is the <code>name</code> and <code>id</code> of the textarea in question):</p>
  
  <pre><code>CKEDITOR.replace( 'confirm_email_text' );
  </code></pre>
  
  <p>This appears to work, as the CKEditor interface appears where the textarea did previously. However, any content entered into this CKEditor textbox does not seem to be saved to the database.</p>
  
  <p>The documentation for CK Editor 4 (the version in use on our version of CiviCRM) also says the following:</p>
  
  <blockquote>
    <p>When CKEditor functions as a replacement for a  element, the integration with the parent  element is automatic</p>
  </blockquote>
  
  <p>(see <a href="http://docs.ckeditor.com/#!/guide/dev_savedata" rel="nofollow noreferrer">http://docs.ckeditor.com/#!/guide/dev_savedata</a>)</p>
  
  <p>Am I missing something here?</p>
  
Tags: <civievent><email><ckeditor>
Title: Is there any way to make a normal textarea in civi editable using CKEditor?
ThreadText: # Is there any way to make a normal textarea in civi editable using CKEditor?
  
  (Asked by: username_0 on 2017-03-20)
  
  I am referring in particular to the textarea that allows one to write a custom confirmation email in the 'Online Registration' tab of an event's configuration page.
  Following the CKEditor integration documentation here (http://docs.ckeditor.com/#!/guide/dev_installation-section-adding-ckeditor-to-your-page), I have added some JavaScript to the bottom of templates/CRM/Event/Form/ManageEvent/Registration.tpl to allow the CKEditor user interface to take over the textarea (where confirm_email_text is the name and id of the textarea in question):
  CKEDITOR.replace( 'confirm_email_text' );
  
  This appears to work, as the CKEditor interface appears where the textarea did previously. However, any content entered into this CKEditor textbox does not seem to be saved to the database.
  The documentation for CK Editor 4 (the version in use on our version of CiviCRM) also says the following:
  
  When CKEditor functions as a replacement for a  element, the integration with the parent  element is automatic
  
  (see http://docs.ckeditor.com/#!/guide/dev_savedata)
  Am I missing something here?
  
  **Tags:** civievent, email, ckeditor
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-03-30. Score: 1 | Accepted answer
  
  So we looked at how one of the existing CKEditor-enabled fields on the page was processed in the civi code base (we chose the footer_text slightly further up the Online Registration page) and tried to replicate the same processing with the confirm_email_text field.
  Based on this, we changed two files.
  1. civicrm/CRM/Core/I18n/SchemaStructure.php
  In the original Civi code on our version this had the following settings for confirm_email_text: 
        'confirm_email_text' => array(
          'type' => "TextArea",
          'rows' => "4",
          'cols' => "50",
        ) ,
  
  We changed this (it was around line 644) to:
        'confirm_email_text' => array(
          'type' => "RichTextEditor",
          'rows' => "4",
          'cols' => "50",
        ) ,
  
  In other words, we changed the type from 'TextArea' to 'RichTextEditor'.
  2. civicrm/CRM/Event/Form/ManageEvent/Registration.php
  In the original Civi code on our version this had the following settings for confirm_email_text:
  $form->add('textarea', 'confirm_email_text', ts('Text'), $attributes['confirm_email_text']);
  
  We changed this (it was around line 423) to:
  $form->add('wysiwyg', 'confirm_email_text', ts('Text'), $attributes['confirm_email_text']);
  
  In other words, we changed the first argument from 'textarea' to 'wysiwyg'.
  One more note
  This code sufficed to display the CKEditor instead of the default textarea, and to save and retrieve the text that was written into it. However, during testing we found that our emails were not displaying images that had a src with a % sign in it properly. This was remedied by altering our Message Templates. They had the following line in them by default for including the custom confirmation text at the top of the confirmation email:
  {$event.confirm_email_text|htmlize}
  
  We simply removed the htmlize filter, so instead we had:
  {$event.confirm_email_text}
  
  This seemed to deal with the problem.
  I should note that we removed the line of code mentioned in my original question from Registration.tpl before implementing the actual working solution above.
  
  
  ---
  
  