geerlingguy / jeffgeerling-com

Drupal Codebase for JeffGeerling.com
https://www.jeffgeerling.com
GNU General Public License v2.0
41 stars 2 forks source link

Add anchor link to comment in comment URL in automated comment emails #128

Closed geerlingguy closed 4 years ago

geerlingguy commented 4 years ago

The email currently links to comments like:

https://www.jeffgeerling.com/comment/11874

But this doesn't take me directly to the comment on the page.

The link should be like:

https://www.jeffgeerling.com/comment/11874#comment-11874

This line:

$comment_url = Url::fromRoute('entity.comment.canonical', ['comment' => $comment->id()]);

Needs to add in the comment ID (comment-11874) as an anchor... and I'm not sure if it's super easy to do that with Url or not.