Skip to content

Instantly share code, notes, and snippets.

@philipn
Created September 30, 2011 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philipn/1253030 to your computer and use it in GitHub Desktop.
Save philipn/1253030 to your computer and use it in GitHub Desktop.
basepath for ckeditor
diff --git a/sapling/ckeditor/templates/ckeditor/ckeditor_script.html b/sapling/ckeditor/templates/ckeditor/ckeditor_script.html
index 7e3f404..6f536be 100644
--- a/sapling/ckeditor/templates/ckeditor/ckeditor_script.html
+++ b/sapling/ckeditor/templates/ckeditor/ckeditor_script.html
@@ -1,5 +1,6 @@
<script type="text/javascript">
<!--
+CKEDITOR.basePath = '{{ STATIC_URL }}js/ckeditor/';
CKEDITOR.replace('id_{{ name }}'{% if config %}, {{ config|safe }}{% endif %});
-->
-</script>
\ No newline at end of file
+</script>
diff --git a/sapling/ckeditor/widgets.py b/sapling/ckeditor/widgets.py
index ea83bc8..9a604dc 100644
--- a/sapling/ckeditor/widgets.py
+++ b/sapling/ckeditor/widgets.py
@@ -101,7 +101,8 @@ class CKEditor(forms.Textarea):
config_str = ''
context = {
'name': name,
- 'config': config_str
+ 'config': config_str,
+ 'STATIC_URL': settings.STATIC_URL,
}
return rendered + mark_safe(render_to_string(
'ckeditor/ckeditor_script.html', context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment