Linking to a specific spot on a page in Google Sites
google-siteslinks
I am looking to link a button to a specific line on a page.
Is this possible using Google Sites?
Best Answer
You can use html anchors in Google Sites, even if by default there exists only for table of content :
Open your page in edit mode, toggle the "HTML source view" and add an anchor like this :
A <a name="serious">serious</a> crime is one which is associated with imprisonment.
You can use this link in the same page (uncheck "Open in a new window"),but if you move your page and the page url change, the link will become invalid.
You cannot add JavaScript directly to your Google Sites page. You can, however add a Google Gadget that has JavaScript in it. You can try the Google Gadget Builder. You may not get the result that you want, however, since your JavaScript is not valid. For example, your statements with (x)html elements will cause the JS engine to error.
var <strong class="highlight">images</strong> = new Array( "image1.jpg",
"image2.jpg",
"image3.jpg");
It may work with E4X, but Google Sites is not rendered as XML. (Yes, it does have the XML doctype, but not the header, so it will not render as XML)
In addition to Google Gadgets, you can also try Google Apps Scripts. It allows for some server side automation.
In order to make a tab show up in the navigation menu of your Sites pages, you will need to add it manually. Creating a new page doesn't add it to the navigation automatically.
Go to:
More > Edit Site Layout > Click the navigation menu > Add Page
You can then select the page you want and it should show up in your navigation menu.
Best Answer
You can use html anchors in Google Sites, even if by default there exists only for table of content : Open your page in edit mode, toggle the "HTML source view" and add an anchor like this :
You can link your page with the link https://sites.google.com/yoururl/page#serious
You can use this link in the same page (uncheck "Open in a new window"),but if you move your page and the page url change, the link will become invalid.