Search code examples
htmlgoogle-sites

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


Solution

  • Sometime in the past month or two Google Sites has now enabled anchor linking. They don't call it that, there's a button at the edge of individual div's that asks if you want to "copy anchor link", but this generates a url that links to that specific block from either an internal or an external page (but only if you've used something other than 'normal' text size - so subheading, title etc... will show this link icon). Can't understand why this wasn't enabled from launch, but ah well, at least it's there now.

    https://i.sstatic.net/CgJaH.png