Tiny MCE popups blank in Django admin

前端 未结 10 856
再見小時候
再見小時候 2020-12-06 00:45

I have got tinyMCE working in the django admin, but all the popups are blank (eg. edit HTML, add image)

The paths to the popup html pages all exist in the right plac

相关标签:
10条回答
  • 2020-12-06 01:35

    I changed the media from being served from http://thatch.media to be http://thatch/media and now it works

    Maybe something to do with being in different domains?

    0 讨论(0)
  • 2020-12-06 01:35

    You have to change the document.domain in tiny_mce_popups.js as well in your config file. The procedures is described here:

    http://wiki.moxiecode.com/index.php/TinyMCE:Cross_domain_loading

    Hope this help.

    0 讨论(0)
  • 2020-12-06 01:46

    I've had the blank popup problem. In my case the problems was having them in another subdomain. Not sure it's your case.

    I solved by editing tiny_mce_popup.js and adding

    document.domain = window.location.hostname.replace('static.','');
    

    Of course replace static with your subdomain to have the "domain.com" string

    Then define again document.domain before attaching .tinymce(...) to your elements. Depending on where you are, you can use server side script for that, or the same code above. See wiki from website here http://tinymce.moxiecode.com/wiki.php/How-to_load_TinyMCE_crossdomain

    0 讨论(0)
  • 2020-12-06 01:50

    I found that the best solution is to just serve tiny_mce media from project root or media dir by setting:

    TINYMCE_JS_URL = '%stiny_mce/tiny_mce.js' % MEDIA_URL
    
    0 讨论(0)
提交回复
热议问题