| 74 | ---- |
| 75 | |
| 76 | === Using TinyMCE with flatpages === |
| 77 | |
| 78 | If you want to use TinyMCE in the admin's textarea for flatpages this thing is a little bit different because you don't have direct access to the model (unless you modify the contrib code which would cause difficulties when upgrading Django). So one way of doing this is to extend the flatpage's admin template. |
| 79 | |
| 80 | To do so you need to: |
| 81 | * Create the directory <your_template_dir>/admin_copies/ |
| 82 | * Copy <your_django_source>/contrib/admin/templates/admin/change_form.html to <your_template_dir>/admin_copies/ This is needed because you are going to extend it and can't access the admin template directly from your local template (acctually a symlink would work fine if you're working in some *nix) |
| 83 | * Create the directory <your_template_dir>/admin/flatpages/flatpage/ |
| 84 | * Create a template in that directory called change_form.html that extends the original admin template |
| 85 | here's mine: |
| 86 | {{{ |
| 87 | {% extends "admin_copies/change_form.html" %} |
| 88 | {% block extrahead %}{{ block.super }} |
| 89 | <script type="text/javascript" src="/site-media/js/tiny_mce/tiny_mce.js"></script> |
| 90 | <script type="text/javascript" src="/site-media/js/tiny_mce/textareas.js"></script> |
| 91 | {% endblock %} |
| 92 | }}} |
| 93 | |
| 94 | |
| 95 | ---- |
| 96 | |