2011-06-20 45 views
2

我有一个内容管理系统,我设计了使用XML文件作为其基础。除了AddThis的标记以外,每一件事情都已经完成并且运行得很好,并没有在tinymce编辑器中显示出来。它甚至不会出现在HTML视图中。除非用户编辑页面的这一部分,否则这不是什么大问题,它会删除addthis控件。AddThis标记不显示在TinyMCE html编辑器

任何想法?

这里的标记是如何在页面上,在XML文件中:

<div style="float: left; margin-top: 1px; font-family: arial; color: #005396; margin-left: 3px; font-size: medium; margin-right: 200px;">Join Our Mailing List</div> 
     <div style="clear: right; float: right;"> 
     <div style="text-align: center; margin-top: 8px; font-family: arial; clear: left; float: left; color: #333333; font-size: large; vertical-align: middle;">Check Out _ Weekly <br /><span style="font-family: arial; color: #005396; font-size: large;">National Polling Summary </span></div> 
     <div class="addthis_toolbox addthis_default_style addthis_32x32_style" style="float: right; padding-top: 15px;"> 
      <a class="addthis_button_facebook"></a> 
      <a class="addthis_button_twitter"></a> 
      <a class="addthis_button_email"></a> 
      <a class="addthis_button_compact"></a> 
     </div> 
     </div> 

这是TinyMCE的

<div style="float: left; margin-top: 1px; font-family: arial; color: #005396; margin- left: 3px; font-size: medium; margin-right: 200px;">Join Our Mailing List</div> 
<div style="clear: right; float: right;"> 
<div style="text-align: center; margin-top: 8px; font-family: arial; clear: left;  float: left; color: #333333; font-size: large; vertical-align: middle;">Check Out _ Weekly <br /><span style="font-family: arial; color: #005396; font-size: large;">National Polling Summary </span></div> 
</div> 

这里的HTML部分是我的TinyMCE的初始化:

tinyMCE.init({ 
    // General options 
    mode: "textareas", 
    theme: "advanced", 
    plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave", 

    // Theme options 
    theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", 
    theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", 
    theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", 
    theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft", 
    theme_advanced_toolbar_location: "top", 
    theme_advanced_toolbar_align: "left", 
    theme_advanced_statusbar_location: "bottom", 
    theme_advanced_resizing: true, 
    relative_urls: false, 
    editor_deselector : "mceNoEditor", 


    // Example content CSS (should be your site CSS) 
    // using false to ensure that the default browser settings are used for best Accessibility 
    // ACCESSIBILITY SETTINGS 
    content_css: "Symba/Styles/CSS/Site.css",   
    // Use browser preferred colors for dialogs. 
    browser_preferred_colors: true, 
    detect_highcontrast: true, 

    // Drop lists for link/image/media/template dialogs 
    template_external_list_url: "lists/template_list.js", 
    external_link_list_url: "lists/link_list.js", 
    external_image_list_url: "lists/image_list.js", 
    media_external_list_url: "lists/media_list.js", 

    // Style formats 
    style_formats: [ 
     { title: 'Bold text', inline: 'b' }, 
     { title: 'Red text', inline: 'span', styles: { color: '#ff0000'} }, 
     { title: 'Red header', block: 'h1', styles: { color: '#ff0000'} }, 
     { title: 'Example 1', inline: 'span', classes: 'example1' }, 
     { title: 'Example 2', inline: 'span', classes: 'example2' }, 
     { title: 'Table styles' }, 
     { title: 'Table row 1', selector: 'tr', classes: 'tablerow1' } 
    ], 

    // Replace values for the template plugin 
    template_replace_values: { 
     username: "Some User", 
     staffid: "991234" 
    } 
}); 

更新

好,我尝试添加这初始化函数

valid_elements: "*[*]", 
extended_valid_elements: "*[*]" 

,并带来股利回来,但我仍然感到没有得到锚标记。

回答

3

FCKEditor和Tinyeditor默认删除空元素。尝试像这样向您的锚点添加空白空间:

<a class="addthis_button_facebook">&nbsp;</a>   
<a class="addthis_button_twitter">&nbsp;</a>   
<a class="addthis_button_email">&nbsp;</a>   
<a class="addthis_button_compact">&nbsp;</a> 


<div style="float: left; margin-top: 1px; font-family: arial; color: #005396; margin-left: 3px; font-size: medium; margin-right: 200px;">Join Our Mailing List</div> 
<div style="clear: right; float: right;"> 
<div style="text-align: center; margin-top: 8px; font-family: arial; clear: left; float: left; color: #333333; font-size: large; vertical-align: middle;">Check Out _ Weekly <br /> 
<span style="font-family: arial; color: #005396; font-size: large;">National Polling Summary </span></div> 
<div style="float: right; padding-top: 15px;" class="addthis_toolbox addthis_default_style addthis_32x32_style"> 
<a class="addthis_button_facebook">&nbsp;</a>   
<a class="addthis_button_twitter">&nbsp;</a>   
<a class="addthis_button_email">&nbsp;</a>   
<a class="addthis_button_compact">&nbsp;</a> 
</div> 
</div> 
+0

我不能将 放入xml中,因为它格式不正确。我会和它一起玩,并回来与你 –

+0

这样做,唯一的问题是,它将图像之间的小破折号和额外的空间。那里有任何想法? –

+0

其实有没有办法解决这个问题? –