No one has responded to this discussion for at least a year, so this information may be out of date. If you're looking for information about this topic, please search for a more recent discussion or post a new question.

bookmark anchors not working

This question is answered This question is answered

I have a long page with several sections. I have successfully used a "back to top" anchor and link using these two HTML modules:

<a name="top"></a>
<a href="#top">back to top</a>

 

The href tag is in various locations on the page (www.thatlldoit.com/Pages/codesamples.aspx). They all take me back to the top.

 

But I've tried doing the same thing to go to bookmark anchors using their href tags listed at the top of the page.

Example:

<a name="#countwkdays"></a>
<a href="#countwkdays" >Count the Number of Workdays Between 2 Dates</a>

None of these work, but I can't see a reason for them to fail. Clicking on the above example changes the IE address to read  http://www.thatlldoit.com/Pages/codesamples.aspx#countwkdays but the page doesn't scroll down to the anchor.

 

What's the deal?

Verified Answer
  • Anchors don't work in the html module because it generates an iframe so they can't reach outside the iframe to the parent page. "Top" may work because # is a generic reference. Use this generator and they will all work.
All Replies
  • Hi Bill Mosca 365,

    This is Jonis from Microsoft SharePoint Online Support.

    When working with SharePoint Online, you have the option to create custom developed solutions like “bookmark anchors”.  While Microsoft allows custom developed solutions, in SharePoint Online, we ask that you support any custom solutions you develop.  I would like to provide you with my best effort, to answer your question, but want to make you aware that the answer is a custom solution outside the bounds of my support.

    Your code looks correct, except you need to close out your countwkdays code word as follows:

    <a name="#countwkdays">

    Test that code change and let me know if it resolves the issue.

    I am testing a method to do this with the PayPal gadget.  If it works, I will write up the steps as an alternate solution.

    If that does not answer your question please let me know as I will continue to monitor this thread for a few days and will reply to any additional posts or questions.

  • Anchors don't work in the html module because it generates an iframe so they can't reach outside the iframe to the parent page. "Top" may work because # is a generic reference. Use this generator and they will all work.
  • Thank you, mchv2.0. The PayPal module did the trick. Clearly, this is a kludgy work-around and O365 should have included a generic module for this kind of thing. More and more, I'm waiting to see if things improve before my free subscription runs out.

  • Bill,

    To be fair, the workaround in OLSB was pretty kludgy too and the ability to edit in Sharepoint Designer is a nice addition. But the inability to use Sharepoint lists and forms on the public site, the dysfunctional editor and the fact that nothing seems to get fixed make 365 in general a poor choice to create a public web site. 

  • I'll I want is to be able to edit things like font tags. I spend more time trying to delete existing tags that surrounded other tags. And, why if we are using CCS, doesn't the editor have a way to select the level like an article header, body text. And the color selector is the pits! You can't see the full spectum of colors. I want a brown and all I get is golden or orange.

    Sheesh!