pydanny / django-wysiwyg

A Django application for making Django textareas rich text editors. Certainly as a template tag and possibly as a form widget.
http://django-wysiwyg.readthedocs.org
MIT License
465 stars 63 forks source link

Height for two wysiwyg-editors in one form #37

Open mfa opened 11 years ago

mfa commented 11 years ago

How can I set a different height for two YUI editors in the same form?

vdboor commented 11 years ago

django-wysiwyg looks for the editor configuration in two JavaScript variables:

You can include a custom django_wysiwyg_editor_configs[field_id] = {...} block below the {% wysiwyg_setup }% tag to make this work.

vdboor commented 11 years ago

reopening for needs-documentation marker.

mfa commented 11 years ago

thx for the help. I solved my issue like this:

 django_wysiwyg_editor_configs["id_field1"] = django_wysiwyg_editor_config;
 django_wysiwyg_editor_configs["id_field1"]["height"] = "200px";
 django_wysiwyg_editor_configs["id_field2"] = $.extend({}, django_wysiwyg_editor_config);
 django_wysiwyg_editor_configs["id_field2"]["height"] = "500px";

jquery.extend is needed to get a copy of django_wysiwyg_editor_config.