User Defined Content

Instead of using a google sheet, use a google doc for each page.

Create a page on google docs add your text, then File>Share>Publish to Web

Copy the link in the publish to web dialog box

then in bss add the following js:

 

fetch('<URL to google doc>').then(function (response) {
 	return response.text();
}).then(function (html) {

 	var parser = new DOMParser();
	var doc = parser.parseFromString(html, 'text/html');
 	var content = doc.querySelector('.doc-content').innerHTML;
	 
document.getElementById("showcontent").innerHTML = content;

}).catch(function (err) {
	console.warn('Something went wrong.', err);
});

Create a div with the ID of showcontent where you want the content to show.

Updated code is now here:

1 Like