2011-03-02 83 views
20

我想允許輸入某些html標記,例如iframe並嵌入Magento的CMS編輯器中。 Magento不允許這些標籤。Magento - 如何允許Magento的CMS編輯器中的某些標籤(iframe,嵌入)?

是否有我可以編輯的模型或控制器,以允許iframe和嵌入標籤?

+0

只是想指出,該編輯器是TinyMCE的,可能已經有用於控制允許的元素的選項。我已經標記了這個問題,以便其他人可以幫助更好。 – clockworkgeek 2011-03-02 12:17:08

回答

37

查找該文件中:JS /法師/ adminhtml /所見即所得/ tiny_mce/setup.js

找到這段代碼:

var settings = { 
     mode : (mode != undefined ? mode : 'none'), 
     elements : this.id, 
     theme : 'advanced', 
     plugins : plugins, 
     theme_advanced_buttons1 : magentoPlugins + 'magentowidget,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,|,forecolor,backcolor', 
     theme_advanced_buttons3 : 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr,|,ltr,rtl,|,fullscreen', 
     theme_advanced_buttons4 : 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,pagebreak', 
     theme_advanced_toolbar_location : 'top', 
     theme_advanced_toolbar_align : 'left', 
     theme_advanced_statusbar_location : 'bottom', 
     theme_advanced_resizing : true, 

,並在其後補充一點:

 extended_valid_elements : 'iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],style,script', 

這是一個簡單的以逗號分隔的想要允許的標籤列表。

+0

這對Magento EE 1.13不起作用;還有什麼要考慮的嗎? – feeela 2014-06-26 13:45:39

3

喬希是正確的目標,我添加了該行接受了「關於Faceb找到我們......」 - IFRAME:

extended_valid_elements : 'iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder|allowTransparency],style,script', 

它有一個額外的屬性自動生成的FB-iframe中那。

-5

編輯CMS頁面時,可以切換到HTML視圖。

enter image description here

通過按HTML按鈕
enter image description here

在那裏,您能在iframe添加到頁面上,就在HTML

+0

這不啓用任何額外的HTML標籤 - 新的編輯和切換到HTML編輯模式,它被刪除。 – tomis 2013-03-20 16:35:07

+0

@tomis當我回答這個問題時,我正在使用magentogo。我不喜歡它,沒有ftp,因此沒有完全控制網站。我發現在cms切換到html模式是一個很好的解決方案,因爲沒有ftp – 2013-03-20 17:24:12

+0

瞭解。順便說一句,我討厭Magento和所有想要我在那裏做任何事的客戶...... – tomis 2013-03-20 17:38:36