How to embed Google Docs into Joomla 2.5 and Joomla 3.0?

  Mark  Wilston    November 28, 2012    3154

 

In the recent times Google Docs has become very popular with the users around the world. It is used to view documents, spreadsheets and presentations online and share them with other users. Now with the advent of Joomla as one of the most popular content management system in the world, many developers use Google Docs as a preferred way to share their documents with other users without converting them into PDF files which cannot be edited by the end user. Here in this article we shall take a look at two methods using which you can embed Google Docs into your Joomla 2.5 and Joomla 3.0 websites.

Make Document Public

Before you begin embedding the Google Docs into the Joomla website, you need to make sure it is public and available to the end user. Check the Google Docs folder and click on the ‘Share’ link at the top of the screen, or else apart from you no one will be able to see the file.

Method 1 – Use Embed Google Docs Viewer Extension

Most developers prefer using the Embed Google Docs Viewer plugin for embedding one or more Google Docs Viewers into a Joomla webpage. This allows the users to view the document on the web browser itself.  To add the viewer to an article all that you need to do is add the URL of the document to embed. Using this plugin you can also define the size of the document and set the permission for the user in terms of preview/edit etc. You can also define the border width and provide a link to the full size document.

This plugin supports a wide variety of file formats including ‘.doc’, ‘.ppt’, and ‘.pdf’ apart from the standard Google Docs format such as document, presentation, drawing, form and spreadsheet. What makes this plugin special is the fact that it provides this functionality on your Joomla webpage without using an <iframe>.

Once the plugin has been installed in your Joomla admin and go to the page where you want the documents to be published. Select the place where you would want the documents to be available to the user and paste the following code.

{google_docs}document_url{/google_docs}
{google_docs}document_url|width:200|height:200|border:1{/google_docs}
{google_docs}document_url|width:200|height:200|link:yes|link_label:Label{/google_docs}
{google_docs}document_url|link:yes{/google_docs}
{google_docs}document_url|mode:edit{/google_docs}

Once you are done all that you need to do is replace the ‘document_url’ string in the above code with the URL of the document from your Google Docs folder.

Note : If the document is password protected or behind any firewall, it won’t be available to the users. In such a case you need to get rid of the password or do away with the firewall. After all, when you are making a document public there isn’t any need to keep it protected!

If you are publishing many documents into the Joomla pages from the same source it would be wise to define the base URL which will make it easier to publish the documents without having to type the entire URL each time.

Method 2 – Using iFrame

The second method of embedding Google Docs in your Joomla 2.5 and Joomla 3.0 webpages is using the iframes. In this case you shall set the of the documents such as the width, length and frame border according to the layout of your Joomla template.  Here you need to copy the embed code from the box and paste in to the Joomla article. The code will read something as

<iframe src="https://docs.google.com/file/d/xyz/preview" width="640" height="480"></iframe>

For this you will need to go to the edit mode and click over to HTML tab paste the code in the area where you would want the documents to appear.

This post is contributed by PixelCrayons, a web development firm that specializes in Ecommerce and CMS website development. You may hire developers here for Wordpress Website Development and Joomla Website Development at affordable rates


 Article keywords:
Google Docs, Joomla 2.5, Joomla 3.0

 


 Share this article: 
Print Digg StumbleUpon del.icio.us Facebook Yahoo! Buzz Twitter Google Bookmarks LinkedIn MySpace Orkut PDF Scoopeo Viadeo Add to favorites
      

© Copyright - Articles XP