Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor links #218

Open
nigelbartlett opened this issue Mar 21, 2018 · 2 comments
Open

Anchor links #218

nigelbartlett opened this issue Mar 21, 2018 · 2 comments

Comments

@nigelbartlett
Copy link

Would be great to have an easy way to create anchor links in content in the CMS. (Eg: to the "Get in Touch" module, or from one section of content to another H2 or H3 heading somewhere else on the same page.)

@imperator99 imperator99 self-assigned this Mar 22, 2018
@imperator99 imperator99 modified the milestone: Sprint 9: 14/02/2018 - 27/02/2018 Mar 22, 2018
@imperator99
Copy link
Contributor

imperator99 commented Mar 22, 2018

@nigelbartlett A module exists to do this: https://www.drupal.org/project/anchor_link.

Unfortunately, it suffers from some rather dramatic drawbacks notably https://www.drupal.org/project/anchor_link/issues/2888087 (tl;dr it conflicts with Drupal core).

Someone else is working on a similar project here but haven't spun it out as a separate module yet (issue for that here).

Until one of those modules becomes viable there's not a lot of options - I don't have the time at the moment to roll my own CKEditor plugin to add this. But I will keep this issue in the backlog so it doesn't go missing.

In the meantime, anchor links can be added via HTML:

  1. Add the anchor: <a id="target-name"></a>
  2. Link to the anchor using the existing tool and the URL: #target-name.

For example, to add an anchor to a heading:
<h2><a id="working-at-the-dta"></a>Working at the DTA</h2>

And then to link to it - this HTML will be generated by the linking tool:
<a href="#working-at-the-dta>Working at the DTA</a>

Or from another page - also cna be added with the linking tool:
<a href="https://url.of.another/page#working-at-the-dta">Working at the DTA</a>

This functionality was removed from core for reasons listed here.

@imperator99
Copy link
Contributor

The other problem with this now is the module, while cleaned up, does not work with Linkit, which is a more valuable module at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants