1

django-cms (2.3.5) + ブートストラップ ベースのテンプレートを使用/テストしています。django-tinymce を使用して、コードを追加します。

<a class="carousel-control right" href="#this-carousel-id" data-slide="next">›&lt;/a>

ただし、django-tinymce は「data-slide="next"」を削除します

<a class="carousel-control right" href="#this-carousel-id">›&lt;/a>

そしてもちろん、何も機能しません。

WYeditor を使用して、settings.py のオプションを変更する方法が見つかりませんでした。tinyMCE を使用すると、次のことができます。

TINYMCE_DEFAULT_CONFIG={
    # General options
    'mode': "textareas",                   
    'theme': "advanced", 
    'remove_linebreaks': "false",

    'convert_urls': "false",
    'relative_urls': "false",
    'theme_advanced_resizing': "true",
    'paste_auto_cleanup_on_paste': "true",
    #'preformatted': "true",

    'valid_elements': "+*[*]",

    'width': "100%",
    'height': "300px",    

    'theme_advanced_buttons1' : "formatselect,separator,bold,italic,hr,separator,link,unlink,separator,bullist,numlist,separator,undo,redo,",
    'theme_advanced_buttons2' : "|,help,code,|",
    'theme_advanced_buttons3' : ""  ,
    'theme_advanced_blockformats' : "p,h1,h2,h3,blockquote",
    'theme_advanced_toolbar_location' : "top",
    # Example content CSS (should be your site CSS)
    #'content_css': 'css/example.css',    
    #'content_css' : "/media/css/tiny_editor.css" 
}

ワークフロー:

  • HTMLポップアップを開きます
  • コードをコピーします
  • ポップアップを再度開くと、必要なコードがそこにあります
  • ページを保存してポップアップを再度開くと、コードが変更されています!

この動作を回避するにはどうすればよいですか?

絶対パスを保持するために、スペース/タブ/コメント/を保持するオプションも追加しましたが、/static/images/path/ は常に ../../../../../static/ に変換されます*。

何を確認/変更する必要がありますか?

ありがとう!

4

3 に答える 3

1

data-slideリンク/タグの有効な属性として宣言する必要があります。tinymce のvalid_elements設定を詳しく見てください。

于 2013-02-08T11:04:34.233 に答える