Rich content section/header links not working in Wix Studio CMS

Question:
Hello, I publish long-format article on my website, and for reader convenience, I offer a quick link/headings summary to aid navigation and or allow readers to pick up where they left off.

This feature used to work great when I was using the Wix Blog. Now however I am using Rich Content in a CMS. All the links are to the correct sections. However, the links do not work on the published article

Product:
Wix Studio

What have you already tried:
Double checked the correct links allocated - the links work within the Rich Content editor, but not on the published article.

Additional information:
Here is a sample article

I think the built-in url#anchor functionality may not exist in Wix Studio

You can implement it manually using wixLocation.query and $w.Element.scrollTo

import wixLocation from 'wix-location-frontend'

const anchor = wixLocation.query.anchor
if (anchor) $w('#' + anchor).scrollTo()

This should cause urls that look like this:
https://yourdomain/some/page?anchor=element
to scroll to the #element supplied to anchor

1 Like

Thank you for your reply Dean. Unfortunately, I am not familiar with code or how to import an anchor into Rich Content.

I am confused that wix would offer this link to section in the Rich Content field in the CMS if it’s not a working function?

Oh, sorry, I misunderstood, I do not think you can link to a point within a rich content element, it is recognized as one single element

1 Like

Thanks again Dean, strange how it’s offered then!

I may be wrong. Where’s it offered?

As above screenshot taken from within the Rich content editor in the CMS. Click link button, you have the option to link to a URL or section of the RC

Ah, I never knew this existed!
It is probably an error that it isn’t working then