Yet another question regarding JS resources load outside of civicrm. We load contact edit form via CRM.popup from a page outside of /civicrm/ path (from custom dashboard page created in drupal). So far [it was] so good; recently we've mentioned that javascript goodies have stopped working on the form; only related message in a browser console is CKEDITOR is undefined. It all goes back to normal after disabling WYSIWYG at "Display Preferences" (we've got same error with TinyMCE enabled). Is it something we could "cure" via configuration tinkering or it is something to report as an error?
2 Answers
Since you are using 4.6, the answer is that you need to ensure templates/CRM/common/wysiwyg.tpl is being loaded and that the smarty variable $includeWysiwygEditor
is set to true
.
Or since you are hacking around CiviCRM anyway, just keep it simple and stick something like this in your page source:
<script type="text/javascript" src="/path/to/civicrm/packages/ckeditor/ckeditor.js"></script>
-
Thank you @Coleman, that simple ckeditor.js include works like a charm! For those who'd be surprised drupal_get_path('module', "civicrm") returns "civircrm/drupal" instead of just "civicrm", there is a simple trick "proudly found elsewhere at stackexchange": $civipath = substr(drupal_get_path('module', 'civicrm'), 0, strripos(drupal_get_path('module', 'civicrm'), '/'));– yurgCommented May 26, 2016 at 10:52
-
I experimented the same issue with 4.7.10
In the New Mail form I cannot see the ckEditor buttons but no javacript error are raised. If I instead go to [Configure CKEditor] page I get the following error:
ReferenceError: CKEDITOR is not defined in abstracttoolbarmodifier.js
-
Going forward with my test and comparing two installation (one working and the other no) it seems the problem is in the database. I mean that pointing one database the editor does not work, pointing instead another one with same source, it work properly. Does anyone have any idea?– marcelloCommented Apr 26, 2017 at 15:34