iframe w edytorz tinymce - np. Google maps

marcincook

Avatar: marcincook

2011-09-02 11:16

Wiele osób kombinuje jak wstawić Google Maps do opisu pełnego przy włączonym Edytorze WysiWyg
Jak wkleja się w kod html tagi <iframe> Tiny usuwa je automatycznie traktując jako nie możliwe do walidacji.

Jak włączyć obsługę tagu iframe w TinyMce

Edytujemy: templates/admin/edit.tpl

Szukamy tam fragmentu


tinyMCE
.init({
        
theme "advanced",
        
mode "exact",
    
entity_encoding "raw",
        
elements "sDescriptionShort,sDescriptionFull,sContent,sDescription",
        
theme_advanced_buttons1 "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outde nt,indent,|,undo,redo",
        
theme_advanced_buttons2 "link,unlink,anchor,cleanup,help,code,hr,removeformat,visualaid,|,charmap",
        
theme_advanced_buttons3 "",
        
theme_advanced_buttons4 "",
        
theme_advanced_toolbar_location "top",
        
theme_advanced_toolbar_align "left",
        
debug false
    
});


i dodajemy wpis o walidacji elementów iframe

extended_valid_elements : "iframe",
Jeśli mamy problem jeszcze z jakimiś tagami html np.: dl dt dd
to wpis powinien wyglądać tak:
extended_valid_elements : "dl|dt|dd|iframe",

Całość powinna wyglądać tak:


tinyMCE
.init({
        
theme "advanced",
        
mode "exact",
    
entity_encoding "raw",
        
elements "sDescriptionShort,sDescriptionFull,sContent,sDescription",
        
theme_advanced_buttons1 "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outde nt,indent,|,undo,redo",
        
theme_advanced_buttons2 "link,unlink,anchor,cleanup,help,code,hr,removeformat,visualaid,|,charmap",
        
theme_advanced_buttons3 "",
        
theme_advanced_buttons4 "",
        
theme_advanced_toolbar_location "top",
        
theme_advanced_toolbar_align "left",
        
extended_valid_elements "dl|dt|dd|iframe"// <<<<<<< tu elementy 
        
debug false
    
});



Można też zabronić używania jakichś tagów kolejnym wpisem :
invalid_elements : "strong,b,em,i",

Od wszystko co potrzebne żeby używać googlemaps przez iframe w edytorze WysiWyg

» Quick.Cms v3.x

"Programy się nie mylą - mylą się programiści"

Do góry
o nas | kontakt