0

Is it possible to use a support file from within the apps script project as a source for iframe in another HTML. I need to do this as a part of a Web App project in Google Apps Script. Specifically I need it to work as a menu system which is the same across multiple pages, so that I don't have to repeat the same HTML code over and over again.

Better explained in a picture

Left side menu(buttons) stays the same across pages

Rubén
  • 34,714
  • 9
  • 70
  • 166
VENUSK
  • 1
  • 1
  • 2
    You could accomplish that with [templated html](https://developers.google.com/apps-script/guides/html/templates) and load the page server side prior to rendering. – Cooper Oct 29 '21 at 12:31
  • Take some time now and learn to use scriplets. It's worth knowing and can save you lots of work. – Cooper Oct 29 '21 at 12:45

1 Answers1

0

There are several ways to accomplish what you are looking (" I don't have to repeat the same HTML code over and over again") but using iframe is not the best way when working with Google Apps Script web applications.

First you have to decide if you want to handle your web application as a multipage or as simple page.

In any case you might find helpful to use templated HTML / scriptlets to pass the code from Google Apps Script .html files to your main html code. If you find yourself scripts hard to start with, then you might use other methods of the HTML Service

Resources

Related

Recent related question (no answers at this time, but with comments)

Rubén
  • 34,714
  • 9
  • 70
  • 166