Re: Can't link to anchors from emails

DeniseGreenberg
Level 4

Re: Can't link to anchors from emails

Thank you, @Jo_Pitts1 !

DeniseGreenberg
Level 4

Re: Can't link to anchors from emails

Hi @SanfordWhiteman & @Jo_Pitts1 The JavaScript was added to the page but the link isn't going to the section. I'm wondering if the section isn't tagged correctly. How should this be done?

 

Thank you,

Denise

SanfordWhiteman
Level 10 - Community Moderator

Re: Can't link to anchors from emails

You’d have to show an example, the idea is you set the usual id attribute.

<div id="MyElement">

 

DeniseGreenberg
Level 4

Re: Can't link to anchors from emails

Hi @SanfordWhiteman - I'm sorry - I don't seem to be seeing your replies in order. They don't seem to be using the div id at all. If this is the section they want to scroll to:

<div class="et_pb_text_inner"><h3 style="text-align: left;"><strong>A 10 year Review of the Earlens System Part 1:</strong></h3>
<p><a href="https://www.earlens.com/wp-content/uploads/2022/02/10_Years_of_Earlens_Research_Levy_Pt1_6_.pdf" target="_blank" rel="noopener">Research on Speech-in-noise and the Pursuit of Hearing Care’s “Holy Grail”<br />
</a></p>
<h5>(Suzanne Carr Levy, PhD, Drew Dundas, PhD, 2022)</h5></div>
			</div> <!-- .et_pb_text -->

Where would the <div id = "hearing-review"> go?

SanfordWhiteman
Level 10 - Community Moderator

Re: Can't link to anchors from emails

It doesn’t need to be a DIV — can be an existing element with the matching id.

 

But certainly they wouldn’t expect the regular #hash method to work without an element with a matching id? It always requires that.

 

(In fact my code is more forgiving and they can use any CSS selector, but I would expect them to have an id considering they thought it would work with the regular jump-link method.)

DeniseGreenberg
Level 4

Re: Can't link to anchors from emails

Is this an ID?

 

<h1><a name="hearing-review">Featured Research</a></h1>

That's the only reference in their code to "hearing-review" which is what they were trying to jump to with the hash.

SanfordWhiteman
Level 10 - Community Moderator

Re: Can't link to anchors from emails

That’s a name, not an id. The spec says a name is eligible as a fallback if it’s an anchor tag. However you would need to include that as

https://www.example.com/?scrollTo=%5Bname%3Dhearing-review%5D

 

 

DeniseGreenberg
Level 4

Re: Can't link to anchors from emails

@SanfordWhiteman - This is solved and working now! Thank you so much for your help!

SanfordWhiteman
Level 10 - Community Moderator

Re: Can't link to anchors from emails

Are we sure this bug still exists in the first place?

DeniseGreenberg
Level 4

Re: Can't link to anchors from emails

Hi @SanfordWhiteman  - Yes, I am sure.