Hi! Sorry but i still keep having issues trying to get an embed youtube video on my websites. Once the page is loaded, the iframe tag is printed as text. Lots of things i did in order to solve this, but none of these works well. Could you give me some variants to debug it ? Thank you!
Comments
If you're using CKEditor, it may be worth looking at what plugins are available for it. There's bound to be YouTube video support...
$config['ckeditor']['default'] = array(
'toolbar' => array(
array('Bold', 'Italic', 'Strike'),
array('Format'),
array('FUELImage', 'HorizontalRule',"Embed"),
array('NumberedList', 'BulletedList'),
array('FUELLink', 'FUELUnlink',"Source"),
array('Undo', 'Redo', 'RemoveFormat'),
array('PasteFromWord', 'PasteText'),
array("btgrid",'Maximize'),
),
'htmlEncodeOutput' => FALSE,
'entities' => FALSE,
'bodyClass' => 'ckeditor',
'protectedSource' => array('/g','/<\/i>/g'),
'toolbarCanCollapse' => TRUE,
'extraPlugins' => 'fuellink,fuelimage,btgrid,widget,dialog,embedbase,notificationaggregator,embed,notification',
'removePlugins' => 'link,image',
'allowedContent' => 'iframe[*]',
'extraAllowedContent'=>'iframe[*]',
'contentsCss' => WEB_PATH.'assets/css/ckeditor.css'
// 'previewParserPath' => fuel_url('preview'),
);
Just pasting the "share" code provided by youtube.
Thanks!
'sanitize_input' => array('template','php'),
$config['modules']['articles'] = array(
'preview_path' => 'articulos/{slug}',
'display_field' => 'title',
'sanitize_input' => array('template','php')
);
Yes, this works fine using markitup.
$config['ckeditor']['default'] = array(
'toolbar' => array(
array('Bold', 'Italic', 'Strike'),
array('Format'),
array('FUELImage', 'HorizontalRule',"Youtube"),
array('NumberedList', 'BulletedList'),
array('FUELLink', 'FUELUnlink'),
array('Undo', 'Redo', 'RemoveFormat'),
array('PasteFromWord', 'PasteText'),
array('Maximize'),
),
'contentsCss' => WEB_PATH.'assets/css/main.css',
'htmlEncodeOutput' => FALSE,
'entities' => FALSE,
'bodyClass' => 'ckeditor',
/*'protectedSource' => array('/\{fuel_\w+\(.+\)\}/g', '/<\?[\s\S]*?\?>/g'), */
'toolbarCanCollapse' => FALSE,
'extraPlugins' => 'fuellink,fuelimage,youtube',
'removePlugins' => 'link,image',
'allowedContent' => TRUE,
"youtube_responsive" => true,
"youtube_related" => false,
"youtube_controls" => true,
"youtube_autoplay" => false
// 'previewParserPath' => fuel_url('preview'),
);
I was thinking if you want i could do a PR to develop branch with this improvement. Let me know what do you think.