How to display the body of the spreadsheet document? - html

So there is some landing page, where link, that opens document in blank page. But it opens with all toolbars and other stuff. The main aim, to display the document in a new window without all the toolbars, only the body of the document (red border on the picture). Here the picture:
How to realize this? With API?

When you open a Google Drive spreadsheet, the URL has "/edit" at the end. If you change this to "/preview" then you will get a view-only version of the spreadsheet.

Related

Use Google App Script to prevent user opening url link in Sheets if site is already open in another browser tab

I've got a Google Sheet that contains numerous hyperlinks.
I'd like to prevent the user from opening multiple instances of the same site.
ie. user clicks the hyperlink in one cell which opens the linked site in a new tab, then attempts to click the same hyperlink while the first new tab is still open - I'd like a dialogue box to appear saying that they cannot open this second new tab until they have closed the first one.
Is this possible via Google App Script?
Many thanks!
Unfortunately not. GAS has no access to your browser data and cannot know what tabs are open.Moreover, GAS has no way of intercepting hyperlink clicks from within a spreadsheet, it can only do that in a side bar, modal (or modeless) dialog, a custom or an add-on menu or an image with a script attached to it.

Display a editable Google Sheet on a web page

I want to display an editable Google Sheet on a web page.
No problem for that.
The problem: I want to display this sheet without the menus, columns and lines. Is it possible ?
Or display the sheet in full screen mode, but I do not know the javascript function to execute when opening the sheet.
Ex.: https://docs.google.com/spreadsheets/d/1xwheykkZMb806JKNoPGcVl17TpIm4Z9LTLJb8HAhVVk/edit?usp=sharing
How to do ?
Thank you
Go to File > Publish to the Web.
And then, you will see this kind of pop up. You can publish it and also get the link. Google Slide and Docs also have this feature. As you can see it, you can also get embed tag for inserting it in HTML. You can stop publishing with the Stop publishing button whenever you want.
And as far as I know, there is no such thing that you can edit the file with that mode.

Serve HTML as a Google Docs, Sheets, Slides, or Forms user interface doesn't work

I'm trying the example presented by Google for adding a menu item that displays a dialog in a Google spreadsheet found here: https://developers.google.com/apps-script/guides/html/ Upon selecting 'Open' from the added menu, the dialog comes up but only displays the title. The 'Hello World' and button do not display. Is their code outdated or ???
Here's a link to a spreadsheet with the example code. Doesn't work for me. Dialog comes up with only the title. https://docs.google.com/spreadsheets/d/1hYMQIlvV39iXHXYkkHanu4bL5p9F0aF7Up-F7oRoHLE/edit?usp=sharing
Thank you Cooper. It turns out it was a browser extension causing the issue.

Google Apps Script to force open the document outline

I'm sending a google doc (view only) out to a bunch of students. I would like the document outline to show by default. I know they can manually go in to the View menu and open the document outline, but is there any way to force open the document outline when students access the document (apps script?)

WiX "HTML embed code" iframe doesn't follow fixed position and z-index

I'm trying to use the WiX "HTML embed code" feature in order to display an iframe on top of my WiX site. The sequence of steps I do is:
Enter Wix admin --> My Sites --> Edit Site
Click +Add --> Apps --> HTML
Increase the size of the gray rectangle so it roughly covers all the visible part of the window
In the 'HTML Settings' dialog:
Select 'Mode' = HTML code
Check 'Show on all pages' below
In the 'HTML / embed code' box, paste my code (see below)
Below the 'HTML / embed code' box, click 'Update'
Close the 'HTML Settings' dialog
In the WiX editor top-right click 'Save'
In the Wix editor top-right click 'Publish' (and confirm)
The code I paste is a piece of JavaScript that eventually creates an iframe. The iframe's style has a fixed position and a very high z-index.
Upon browsing the site, the iframe is actually created and displayed, but with two strange effects:
The position is set not relative to the whole window (as 'fixed' position should be), but rather relative to the original gray object representing the HTML app during the WiX edit.
Some elements of the original WiX template - hide sections of the iframe, regardless of how high I set its z-index to be.
Any help is appreciated.