[SOLVED] News module and embed Youtube

  • Is it possible to embed a Youtube iframe in the News module. I have looked at making some changes in the HTMLPurifier settings, but without any success.

    Any ideas?

    I would like to embed some of my Youtube videos into some of my articles.

    Thanks for any help.

  • I tried to work with HTMLPurifier ... but gave up. Too bad. I have installed the "Content" module and am embedding with this instead ... works great! Not sure if the code in the content module could be copied to the news module?

    Would still be handier to be able to add video to the News module somehow.

  • I have thought of doing this using the old Multihook extension, but haven't gotten to it. Theoretically it should work great, but would take some coding and testing. Basically, you would create a new "needle' called YOUTUBEURL and embed the video with something like YOUTOBEURL("https://www.youtube.com/watch?v=7KcqcPWV0VU", and multihook could then transform that into a full set of tags to display the video. Parameters to set size or other options would be helpful too.

    The only other way to do it is to enable all the tags needed to support it, and that could be dangerous in a public CMS.
  • seems I remember reading that one of the Scribite WYSIWYG editors allowed youtube embedding... not sure.
  • I just looked at the Scribite editors and Xinha does indeed do Youtube and it works! You just have to go into your Scribite editor settings and tag "Youtube". Thanks!

    However, it looks like there has not been any movement on the Xinha site since 2013 ... although they say they do not actively work on the Xinha code until they have a need to do so.

    CKEditor on the other hand is very much under constant development, however, I tried both the "Youtube" plugin and the "Youtube, Vimeo and DailyMotion" plugins, but they did not work. They installed correctly, but did not get pas the HTMLPurifier settings.
  • Code

    I have found that YouTube videos can be viewed on News pages with small changes to the code
    This is an embed code produced by YouTube
    (  <iframe width="640" height="360" src="https://www.youtube.com/embed/3x2ABSAMVno" frameborder="0" allowfullscreen></iframe> )
    Change this to
    (  <p><iframe width="640" height="360" src="https://www.youtube.com/embed/3x2ABSAMVno" frameborder="0" allowfullscreen=""></iframe></p>)
    Just change the video number/code
    It works for me icon_smile
    New topic in 'Modules' forum
Moderated by: Support (Group)