admin = meta.Admin(js =
('js/tiny_mce/tiny_mce.js','js/tiny_mce/textareas.js'),)
it didn't work although i have the javascript in the folder js that is
in media file
is this because it is already written txt feilds with html so he can't
change it to the tinymyce format
thanks,
Mary
View the source of an admin page where tiny_mce should appear. Check
the <script> tags. You should have something like this (I've set my
ADMIN_MEDIA_PREFIX to '/admin_media/'):
<script type="text/javascript" src="../../../jsi18n/"></script>
<script type="text/javascript" src="/admin_media/js/core.js"></script>
<script type="text/javascript"
src="/admin_media/js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript"
src="/admin_media/js/textareas.js"></script>
Now verify that your browser can load these paths. Try e.g. the url:
http://your.domain.com/admin_media/js/tiny_mce/tiny_mce.js
You should see some javascript code. If you get an error, your tiny_mce
directory is not in the right place. It should be inside the admin
media directory.
The colors links made with tiny_mce will follow the current CSS
definitions. You can use Firefox and the Web Developer extension to
take a closer look at what's happening at the html/css level.
I got good results by following these guidelines when pasting stuff
into tiny_mce:
- do all formatting in CSS
- no formatting attributes in HTML, only id= and class=
- strip all extra tags and attributes in tiny_mce
In my textareas.js, I made the following changes compared to the django
howto:
theme_advanced_buttons1 :
"fullscreen,separator,formatselect,bullist,undo,redo,separator,link,unlink,separator,cleanup,code",
plugins : "save,fullscreen",
valid_elements : "a[href|title],p,br",
invalid_elements : "font,span",
This way my HTML keeps relatively clean and I get good results even
when copy-pasting from word processors. Of course, I add more valid
elements when I see a real need for them.
I also like the stripped-down user interface. No extra buttons, only
add new ones when they're really needed.