Tiny myce

6 views
Skip to first unread message

mary

unread,
Feb 8, 2006, 10:16:50 AM2/8/06
to Django users
i already built a project with Django and it looks great but after
filling the project with all the data and after filling the txt feilds
the client want to use the tiny mice as it is more easy for him so when
i write in my pages model this line

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

akaihola

unread,
Feb 8, 2006, 3:32:46 PM2/8/06
to Django users
The tiny_mce editor should appear nevertheless.

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.

mary

unread,
Feb 9, 2006, 3:50:33 AM2/9/06
to django...@googlegroups.com
Thanks very much it is working now
and i am testing it but the problem that i am facing a problem is that
TinyMyce is changing the Html code that i am writing i don't know why?
and how i could let him write the html code that i need
as example my Url has certain color but he changes them to the blue
color which i don't want

akaihola

unread,
Feb 9, 2006, 7:02:55 AM2/9/06
to Django users
Doesn't your HTML render as expected in the editor, or do you get
unexpected results when viewing the resulting HTML outside admin? If
you're used to hand-coding your HTML, remember that with wysiwyg
editors, your HTML is not your HTML anymore: you'll have to live with
the machine-generated markup.

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.

Reply all
Reply to author
Forward
0 new messages