Onno Benschop
Onno Benschop

Reputation: 11

How do I insert a Google Document into a Google Site using Google Apps Script

Using Google Apps Script, how can I accomplish the same as "Insert" -> "Document" within the Google Sites Editor?

Using GAS, I can obtain the URL and/or the ID of a document, but I cannot create the equivalent of an embedded Google Document within a Google Site Page.

I have been able to insert an <iframe>, but that assumes that the document has been published as a web-document.

I can copy the html from an existing page and using replace() substitute a different ID, but that only appears to work if the original page gadget has borders and title turned on.

Upvotes: 0

Views: 391

Answers (1)

Srik
Srik

Reputation: 7957

I think the approach you mentioned should work. Have a 'template' page with a dummy Google Document inserted in it and then use Apps Script to replace the dummy with your document. Can you put in some code around the replace you have.

Upvotes: 1

Related Questions