2018版新Google Sites添加嵌入按钮并链接站内页面的方法
Hey Mario, I’ve dealt with this exact frustration before when working with custom code on Google Sites—here’s two reliable ways to get the correct internal link for your Contact page, even before publishing:
Method 1: Grab the URL from Preview Mode
- Open your Google Sites editor and navigate to the Contact page you want to link to
- Click the Preview button (the eye icon in the top toolbar) to open the page in a new tab
- Copy the full URL from the address bar. It’ll look something like:
https://sites.google.com/view/your-site-name/contact?preview=ABC123&authuser=0 - Strip off the extra preview parameters (everything starting with
?), leaving you with the core URL:https://sites.google.com/view/your-site-name/contact - Use this cleaned-up URL in your button’s
hrefattribute—once you publish the site, this link will automatically point to the live Contact page.
Method 2: Copy the Link from the Editor’s Insert Tool
- In the Google Sites editor, highlight any random piece of text (you can delete it later)
- Click the Insert link button (chain icon) in the toolbar
- In the link popup, select This site from the left sidebar, then find and click your Contact page
- Instead of clicking "Apply", right-click on the selected Contact page option and choose Copy link address (wording varies slightly by browser)
- Paste this copied URL directly into your button code—this is the official internal path that will work both in preview and after publishing.
A quick note: Google Sites keeps page paths consistent between the unpublished editor preview and the live site, so you won’t have to update the link once you hit publish.
内容的提问来源于stack exchange,提问作者Mario
相关产品推荐
相关产品推荐

