Widget:Google Spreadsheet

This widget allows you to add Google Sheets to your wiki page.

Add Template:Spreadsheet directly under the widget to allow readers access to the spreadsheet. The template documentation contains an example.

Usage
There are four supported URL formats.

First URL format
The URL looks like this: https://docs.google.com/spreadsheets/d/1pxLq_tSUlY2xEAYlK7R2pu70nT27Jn363WtlCqtAdIc/edit#gid=661167613

Parameters:
 * key - key parameter in document URL
 * width and height define spreadsheet dimensions, 500x300 is default, but you might want to copy it from embed code since size depends on fields you have

To insert this widget, use the following code:

Results in:

Second URL format
The second format has a URL which looks like this: https://docs.google.com/spreadsheets/d/e/2PACX-1vRhM_MeJnMphY5A1zuOvAr7IL2Jj41Qg51Scd6MoNj0TIjC2LHVqjUwudbIwa-26Ulgh1kzzTTLBfif/pubchart?oid=226162492&?widget=true&amp;headers=false

Parameters:
 * key - key parameter in document URL
 * oid - object ID in document URL
 * width and height define spreadsheet dimensions, 500x300 is default, but you might want to copy it from embed code since size depends on fields you have

Results in:

Third URL format
The third format has a URL which looks like this: https://docs.google.com/spreadsheets/d/e/2PACX-1vQmKS6wsrz6q34e2A7PF_4Pu7MDkChqmIQ8f8PAe-jAmQcmYx1ub-ruE--cmAql0zfI6H1PmqQbcNCb/pubhtml

Parameters:
 * key - key parameter in document URL
 * pubhtml - must be present and blank
 * width and height define spreadsheet dimensions, 500x300 is default, but you might want to copy it from embed code since size depends on fields you have

Results in:

Fourth URL format
The fourth format has a URL which looks like this: https://docs.google.com/spreadsheets/d/e/2PACX-1vQmKS6wsrz6q34e2A7PF_4Pu7MDkChqmIQ8f8PAe-jAmQcmYx1ub-ruE--cmAql0zfI6H1PmqQbcNCb/pubchart?oid=798669522&format=interactive

Parameters:
 * key - key parameter in document URL
 * oid - object ID in document URL
 * pubchart - must be present and blank
 * width and height define spreadsheet dimensions, 500x300 is default, but you might want to copy it from embed code since size depends on fields you have

Results in:

Security NOTE
Keep in mind that to use this widget you must make the document you're publishing to be open for everybody to see which might be undesirable for some uses (intranets, closed groups and etc.)

Widget internals
Documentation for this widget can be found at MediaWiki Widgets.

The first URL format is based on the Google Sheets "Embed" code shown in Google Docs — Support — WordPress.com.

Subsequent formats are based on actual URLs.

Widgets do not use parser functions. Instead, a template programming language known as "Smarty" is used. Refer to the Smarty 3 Manual for the details.







