Select to view content in your preferred language

Url link to a html anchor on a different page

556
3
01-04-2024 09:08 AM
Labels (1)
LeiBai
by
New Contributor

I am using Sites (which I assume is very similar to Hub) to create a web site and I ran into a problem of referencing a specific section on a different page. 

In one of the child pages, I created an anchor for a specific section by adding <div id="section"> in the text box using html editing. On the same child page, I can add a link to this section by using <a href="#section">. However, I can't find a way to refer to this anchor if I am on a different page.

For example, if the link to the child page is <a href="#/site_name/pages/childpage">, I've tried many different url format but none of them works:

<a href="#/site_name/pages/childpage#section">

<a href="#/site_name/pages/childpage/#section">

<a href="#/site_name/pages/childpage%23section">

<a href="#/site_name/pages/childpage%2F%23section">

Have anyone succeeded in doing this?

Any help is appreciated! Thanks!

3 Replies
rwrenner_esri
Esri Contributor

I'm seeing that both of the following formats work when linking between separate pages (link clicked on home page, goes to section to child page). Curious whether you've tried other browsers or clearing your browser cache?

Works:

<a href="#/site_name/pages/childpage#section">

<a href="#/site_name/pages/childpage/#section">

Using link url:

<a href="https://SITENAME.hub.arcgis.com/pages/childpage/#section">

I'm working on Chrome version 120.0.6099.130 (Official Build) (64-bit).

0 Kudos
LeiBai
by
New Contributor

I was using Edge and just tried Chrome too. However, it still doesn't work. The link will take me to the child page, but not the specific section. 

Maybe this is a problem specific to Sites, not Hub?  

0 Kudos
rwrenner_esri
Esri Contributor

There are definitely functionality differences between Hub on AGOL and Sites so thanks for highlighting that. What version of Enterprise are you on?

0 Kudos