<p>As of <a href="https://craftcms.com/changelog#build2759" rel="nofollow">Craft 2.5.2759</a> this is now possible.</p>

<blockquote>
  <p>It is now possible to include custom URL fragments in links to entries within Rich Text fields, alongside the entry's reference fragment (e.g. <code>href="my-entry#custom-fragment#entry:123</code>").</p>
</blockquote>

CC BY-SA 3.0
2016-01-22T01:16:41.767Z
2016-01-22T01:16:41.767Z
Brad Bell
<p>This is more of a workaround than a truly official method. The <code>#entry:id</code> you are seeing is more of a reference for Craft to figure out the correct URL when you edit the entry later. If you were to look at the link live, you would notice that the hash is missing.</p>

<p>The workaround is to create a link to an entry. Then, either save and return or toggle <code>Edit Source</code>. When you return, you can click on the link to find a tiny popup giving you the option to <code>Edit</code> or <code>Unlink</code>. When you edit, you can change the hash to anything you like. It should save just fine.</p>

CC BY-SA 3.0
2015-04-03T04:09:00.333Z
Yes, I tried that — Unfortunately, without the [Reference Tag](http://buildwithcraft.com/docs/reference-tags) syntax in the hash, Craft stops treating the link as a *Link to Entry* and simply treats it like a static link. (As long as you keep the Reference Tag syntax in the hash, Craft converts the link into an actual (Reference Tag)[http://buildwithcraft.com/docs/reference-tags] when it stores the content in the database, so the link will remain relative to the proper siteUrl when it's parsed in the template.) I need the link to be self-updating across environments.
Michael Rog
CC BY-SA 3.0
2015-04-03T11:02:18.547Z
Yes. That's not built in, and why I called this a workaround. It could probably be done with a plugin. A `Link to Entry Anchor` if you will.
Bryan Redeagle
CC BY-SA 3.0
2015-04-03T03:21:05.590Z
2015-04-03T03:21:05.590Z
Bryan Redeagle
<p>I need to link to a particular <code>#anchor</code> on a page from within the WYSIWYG editor. </p>

<p>However, if I start by using <em>Link to Entry</em> in the Rich Text editor, Redactor adds its own 'anchor' (with the same syntax as the Reference Tag for the entry page), and any additional anchors I add to the URL using the <em>Edit Source</em> functionality are ignored.</p>

<p>How would you suggest creating enabling users to create links to specific parts of Entry pages from within the Rich Text editor?</p>

<redactor><wysiwyg>
How to link to an anchor on an entry page from within Rich Text editor
# How to link to an anchor on an entry page from within Rich Text editor

(Asked by: username_0 on 2015-04-02)

I need to link to a particular `#anchor` on a page from within the WYSIWYG editor.

However, if I start by using *Link to Entry* in the Rich Text editor, Redactor adds its own 'anchor' (with the same syntax as the Reference Tag for the entry page), and any additional anchors I add to the URL using the *Edit Source* functionality are ignored.

How would you suggest creating enabling users to create links to specific parts of Entry pages from within the Rich Text editor?

**Tags:** redactor, wysiwyg


---

## 2 answers

### Answer by username_1 on 2016-01-22. Score: 4

As of [Craft 2.5.2759](https://craftcms.com/changelog#build2759) this is now possible.

> It is now possible to include custom URL fragments in links to entries within Rich Text fields, alongside the entry's reference fragment (e.g. `href="my-entry#custom-fragment#entry:123`").


---

### Answer by username_2 on 2015-04-03. Score: 1

This is more of a workaround than a truly official method. The `#entry:id` you are seeing is more of a reference for Craft to figure out the correct URL when you edit the entry later. If you were to look at the link live, you would notice that the hash is missing.

The workaround is to create a link to an entry. Then, either save and return or toggle `Edit Source`. When you return, you can click on the link to find a tiny popup giving you the option to `Edit` or `Unlink`. When you edit, you can change the hash to anything you like. It should save just fine.

> **Comments:**
> **username_0**: Yes, I tried that — Unfortunately, without the [Reference Tag](http://buildwithcraft.com/docs/reference-tags) syntax in the hash, Craft stops treating the link as a *Link to Entry* and simply treats it like a static link. (As long as you keep the Reference Tag syntax in the hash, Craft converts the link into an actual (Reference Tag)[http://buildwithcraft.com/docs/reference-tags] when it stores the content in the database, so the link will remain relative to the proper siteUrl when it's parsed in the template.) I need the link to be self-updating across environments.  
> **username_2**: Yes. That's not built in, and why I called this a workaround. It could probably be done with a plugin. A `Link to Entry Anchor` if you will.  

---

