Search code examples
salesforceapex-codevisualforce

How do I embed a video in a knowledge article?


I want to embed videos in my knowledge articles, and I have been trying to follow the steps from these two posts: http://boards.developerforce.com/t5/General-Development/Embedded-Video-in-New-Knowledge-Base/td-p/19... http://success.salesforce.com/ideaView?id=087300000006n6v

Under Setup->Customize->Knowledge->Article Types, I have an article type of "Video Tutorial" with the title test_video_tutorial. I have a custom field called "Tutorial" with an API name of "Tutorial__c".

In Article Management, I created a new article of type "Video Tutorial" and the Tutorial field I have this: <div class="youtube">http://www.youtube.com/v/TDArzCNu178?</div>

In Setup->Develop->Pages, I created a new Visualforce Page called VideoTutorialPage like this:

<apex:page standardController="Video_Tutorials__kav" showHeader="true">
    <apex:outputPanel >
        <apex:outputField value="{!Video_Tutorials__kav.Title}"/>
        <apex:outputText escape="false" value="{!Video_Tutorials__kav.Tutorial__c}"/>
    </apex:outputPanel>
</apex:page>

However, when I click on the article "test_video_tutorial" in my Articles, the video doesn't get embedded. I just see the html code for it. Is there something I have to do to tell Salesforce that when I click on a Video Tutorial article, that it should use the Visualforce Page I created? What is it that I have to do to get the video to show up?


Solution

  • In the Summer 12 release this was made a lot easier by allowing <iframe> tags in knowledge articles. See the Summer 12 release notes (section "Multimedia Content in Articles") for details