Page 1 of 1

BBCode and method to allow users to edit a GoogleDocs Doc

Posted: 09 Jan 2013, 00:33
by Martin_K
GoogleDocs allows wiki style collaborative document editing, with the advantage over most wikis of being WYSIWYG, and allows several people to edit simultaneously and is a fairly standard word processor layout that most will be familiar with, so can be a useful addition to your forum.
  1. Create a GoogleDocs document in your account
  2. Click the Share button top right and name your document, if not already named
  3. Next to Who has access, by default set to 'Private', click the 'change..' link, select 'Anyone with the link', then click Save.
  4. Copy the Link to Share
I then created the following BBCode to display this in an iFrame.

BBCode usage:

Code: Select all

[gdoc]{IDENTIFIER}[/gdoc]
HTML replacement:

Code: Select all

<iframe src="https://docs.google.com/document/d/{IDENTIFIER}/edit" width="800" height="800" border="0"></iframe>
Not sure if everyone gets the /d/ folder, so you may need to change this. The 'edit' at the end of the URL means you are putting the document in 'edit mode'. You may also want to change the width and height.

Help line:

Code: Select all

The code between https://docs.google.com/document/d/ and /edit
Having installed Stoker's PrettyPhoto attachment mod, I also created the following BBCode to popup from a link (keeps the user on your site) and displays the document for editing in a PrettyPhoto iFrame:

BBCode usage:

Code: Select all

[gdoc_link="{INTTEXT}"]{IDENTIFIER}[/gdoc_link]
HTML replacement:

Code: Select all

<a href="https://docs.google.com/document/d/{IDENTIFIER}/edit? iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]" title="{INTTEXT}">{INTTEXT}</a>
Help line:

Code: Select all

After = the link as you wish it to appear, then, the code between https://docs.google.com/document/d/ and /edit
If you want to discuss a document, then the iFrame can be posted in the first post, then discussion takes place in the forum posts below it. As the link will only be visible, and known to those who can see it on the forum, this may give the document a degree of privacy. I hope someone finds this useful. ;)