Search form
Feb 13 2009

How to add the YouTube plugin in Hippo CMS 7

The YouTube Template Plug-in is a very simple, but cool project in the Hippo ECM forge. The plugin was created by our former intern Jeroen Tietema. With this plug-in you can easily add YouTube videos to your documents. In this blog I'll explain how to add this plug-in into your Hippo ECM project. I assume you have already checked out and built Hippo ECM from source.

Check out the YouTube plug-in from SVN and build it using Maven with the following command:

mvn install

Then add the dependency to the pom.xml of quickstart/war

      <!-- YouTube Template plugin for Hippo ECM 2.03.00 -->
      <dependency>
      <groupId>org.onehippo.addon.frontend.youtube</groupId>
      <artifactId>youtube-plugins</artifactId>
      <version>1.01.00-SNAPSHOT</version>
      <type>jar</type>
      </dependency>
      

Configuration in the console

(Re)start the Hippo ECM war and go to the console on http://localhost:8080/cms/console. Hippo ECM Console Navigate to the following location:

/hippo:namespaces/hippo/templatetype/hippo:template/hippo:template/list

Now add the value Youtube to the templates property and save the changes. Make sure you log out of the CMS and back in (the list is cached in your session).

CMS template editor

Template editorGo to the template editor in the CMS. You can either create a new document type or add the new YouTube field to an existing template. Save the template and choose "Update all content" from the drop down menu in the top bar.

Editor

Add Youtube movie to a documentNow the plug-in has been configured and added to the template, the CMS users can add YouTube videos to their documents. Just paste the ID of the video into the YouTube field.

If you are not editing the document you get a preview of the selected video:
04_preview

3 comments

Anonymous said

Thanks for the help. I have succeed to retrieve video id. Problem was in doBeforeRender and I solved it :). Most of the problem was caused because this plugin was the first thing I have tried with Hippo 7 :D.
For embeding video code in the site I have used code similar to one in CMS plugin.

23 September 2009 15:17

Jasha Joachimsthal said

If the path of your field is "defaultcontent:youtube", then create a getYoutube() method in your HST bean for your document type. In the JSP you can access it then with {myBean.youtube}

10 September 2009 16:44

Anonymous said

Hi, I have tried adding this plugin to cms and it works :).
Can you explain how this can be used on frontend (site)? I have created project with Hippo Site Toolkit Archetype, and I am trying to show video on home page, but I can't extract video id information :/

8 September 2009 15:49