quick and dirty Google Sheets overlay script

last update: 14 June 2020

The following is a quick and dirty script to overlay static HTML pages with values pulled from Google sheets.

The sheet for this demo can be found: Content Sheet.

The script will pull the content of one or more sheets from Google and will replace the content with the referenced part of the spreadsheet.

getting it to work

When the page has loaded the JavaScript will run and replace all required values on the page with the values updated from the sheet.

example

This is a very simple example of SheetCMS working non-obtrusively.

This is an example of referencing a sheet that has already been loaded elsewhere on the page.

under the hood

The script is split into two "init" and "render" which can be called once the document has loaded. The split enables inbuilt render functions to be ignored and the populated JSON to be used instead. Their functions breakdown:

Should you wish to find out more about what think play solve can do for your company please review the hire page. Alternatively if you wish to talk please get in touch.

Want to find more about the what we are playing with please view our projects page.