Skip to content

Generating the shortcode

r-a-y edited this page Apr 14, 2020 · 4 revisions

Embedding most documents

  1. First, you'll need to find the public URL of your Google Doc file. Follow this guide, then move on to step 2.
  2. Then, your shortcode should look like this:
[gdoc link="THE LINK YOU COPIED" height="800"]
  1. Next, you can either copy and paste the shortcode into the:
    1. Block Editor - by using the Shortcode block
    2. Classic Editor - You might need to put the shortcode on its own line.

You can also customize the shortcode by using some custom parameters mentioned below.

Embedding an audio file

Follow the steps above, but change the shortcode to:

[gdoc link="THE LINK YOU COPIED" type="audio"]

Notice the type is set to audio.

When you embed an audio file, we will use the browser's native HTML5 audio player.

Embedding a form

  1. Navigate to your Google Form
  2. Click on the Send button, followed by the Send via link icon.
  3. Next, click on the Copy button to copy the link.

You can also view this GIF:

GIF to get a form's URL

Lastly, follow step 2 from the "Embedding most documents" section above.

Embedding any other file

Note: This is only needed in v0.4.

For every other file type (image, PDF, Microsoft Office, etc.), follow the steps above, but change the shortcode to:

[gdoc link="THE LINK YOU COPIED" type="other"]

Notice the type is set to other.

When you embed a miscellaneous file, we will use Google's preview embed viewer to display the file.

Other shortcode parameters

Here are some other custom parameters you can use with the shortcode:

  • "width" - By default, this tries to use your theme's content width. If this doesn't exist, the width is "100%". Fill in this value to enter a custom width.

  • "height" - Enter in a custom height for your Google Doc if desired. Defaults to "300". Avoid percentages.

  • "seamless" - This parameter is only applicable to Documents. If you enter "0", this will show the Google Docs header and footer. Default value is "1", which means that no Google Docs header or footer will be shown. Note: This option only works if your document was published to the web and not link-shared.

  • "size" - This parameter is only applicable to Slides. You can enter in "small", "medium" or "large" to use the presentation preset sizes. Dimensions for these presets are: small (480x299), medium (960x559), large (1440x839). To set a custom width and height, use the "width" and "height" parameters listed above instead.

  • "type" - This parameter is only applicable to non-Google Doc types. If the file you want to embed is an audio file, set the type to audio. Otherwise, set the type to other for every other file type (image, PDF, Microsoft Office, etc.) and we will attempt to embed the file using Google's preview embed viewer.