2013-11-13 5 views
0

У меня есть код, который должен выглядеть так: при открытии в CKEditor через PHPCKEditor зачистки код вниз

<div class="menuslct"> 
    <table width="980" border="0" style="text-align:center"> 
    <tbody><tr> 
     <td width="33%"><a href="/en/education"><img src="/common/img/icons/01 online.PNG" name="online" width="81" height="78"></a></td> 
     <td width="33%"><a href="http://esukhia.org/en/education/immersion"><img src="/common/img/icons/02 immersion.jpg" name="immersion" width="80" height="78"></a></td> 
     <td width="33%"><a href="http://esukhia.org/en/education/thesisadv"><img src="/common/img/icons/03 Thesis Advisor.jpg" width="78" name="thesisadv" height="78"></a></td> 
    </tr> 
    <tr> 
     <td width="33%" name="online">Online</td> 
     <td width="33%" name="immersion">Immersion</td> 
     <td width="33%" name="thesisadv">Research Advisor</td> 
    </tr> 
    </tbody></table> 
</div> 

, но вместо этого включают в себя:

<textarea name="editor1" id="editor1"> 
     <?php echo file_get_contents('education.php');?> 
    </textarea> 
     <script> 
      CKEDITOR.replace('editor1'); 
     </script> 

это выглядит следующим образом:

<div class="menuslct"> 
<table border="0" style="text-align:center; width:980px"> 
<tbody> 
    <tr> 
     <td><a href="/en/education"><img src="/common/img/icons/01 onlie.PNG" style="height:78px; width:81px" /></a></td> 
     <td><a href="http://esukhia.org/en/education/immersion"><img src="/common/img/icons/02 immersion.jpg" style="height:78px; width:80px" /></a></td> 
     <td><a href="http://esukhia.org/en/education/thesisadv"><img src="/common/img/icons/03 Thesis Advisor.jpg" style="height:78px; width:78px" /></a></td> 
    </tr> 
    <tr> 
     <td>Online</td> 
     <td>Immersion</td> 
     <td>Research Advisor</td> 
    </tr> 
</tbody> 
</table> 
</div> 

Почему это ckeditor, лишенный моего кода?

+0

Вы должны взглянуть на руководство [Advanced Content Filter] (http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter). Вам необходимо настроить эту функцию. – oleq

+0

Возможный дубликат [ckeditor strips inline attributes] (http://stackoverflow.com/questions/15753956/ckeditor-strips-inline-attributes) – oleq

+0

Я попытался добавить этот 'config.extraAllowedContent = 'td {*}';' к config.js, но он ничего не менял ... (решение, которое я нашел здесь http://ckeditor.com/forums/Support/Allow-inline-style-with-Advanced-Content-Filter) – Lou

ответ

0

Я получил это работает, вызывая эту CKEditor таким образом:

CKEDITOR.replace('editor1',{allowedContent: true}); 

это удалить все CKEditor вскрышных функции.

+0

Вы должны 'used' td [width] 'вместо' td {*} 'при определении' config.extraAllowedContent'. Ширина - это не стиль, а атрибут. Нет необходимости отключать всю функцию, так как она защищает ваш HTML от мусора и грязных вещей. – oleq

Смежные вопросы