Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to add anchor and/or Id tag in New Google Sites

I'm trying to create a website using the New Google Sites - where a lot of basic 1990's html functionality has been removed. It would be REALLY useful to add anchors, but the gSites FAQ states that anchors as not supported in the New Google Sites. There are no 'easy' anchor buttons etc... So I thought I could end-run them and code in an ID tag inside since you can insert custom html.

At the relevant section on the page I wrote, using their HTML insert tool:

<p id="assignment2"><hr></p>

Then call it up at the top of the webpage using their HTML insert tool:

<p><a href="#assignment2">Assignment #2</a><p>

That returned an error after publishing it and trying to follow the link. So I instead tried just writing Assignment #2 and adding a hyperlink to is pointing to:

https://sites.google.com/view/<websiteurl>#assignment2

This results in going to the top of the page, but never jumping down to the relevant anchor.

Are there other clever methods somebody can think of to jump to a specific spot on a page if the ID tag appears to be non-functional?

TIA

like image 339
James Avatar asked Oct 29 '22 18:10

James


1 Answers

So many people asking this question... I can't believe it doesn't work, the whole point of the HT in HTML is that you can link anywhere within or between public documents. Anyway I think I've found a lame workaround. Though the issue is it gives you a redirect notice.

All the header tags are given an ID. You can copy this id, then add a link in with the full URL of your Google Sites page, followed by the # and the id.

Eg:

https://sites.google.com/view/{your-google-sites-alias}/home#{id-from-heading-tag}
like image 131
Cameron Avatar answered Nov 12 '22 19:11

Cameron