1

In Drupal 8 CKEditor WYSIWYG editor when I create a link to an internal page I use this URL path which I type manually: /parent/child/pagename

I then found a few buttons that can be added to the CKEditor interface that allow you to search for existing pages and it autoatically creates these paths.

e.g. These seem to be the best options:

https://www.drupal.org/project/ckeditor_entity_link

https://www.drupal.org/project/linkit

The problem I have is that it inserts the link into the HTML like so which is static:

 <p><a href="/parent/child/pagename">test</a></p>

When I then change that page name or location to someting else the link breaks.

What I'm looking for is a plugin that inserts dynamic links, similar to this concept using that the page node ID or whatever uniquie identifier Drupal uses never changes:

  <p><a href="$PAGENODEID$">test</a></p>

so no matter what the page name/path/url is it will always link to the same page.

I know there is the option of setting up page redirects for old URL alias though without going into detail why that is not a solution for me in my case please leave that suggestion aside I already know of that. :)

Thank you

2

I'm the maintainer for Linkit module.

Linkit 8.x-5.x is solving the problem you describe with static URL:s.

The new version is using data-attributes (UUID and some other values) that calculates the URL in "run time". That solves the issue.

Remember to also enable the Linkit filter in your text format configuration. Also, make sure that the data attributes are added to the HTML filter allowed values if you use that filter.

  • Thank you for this information. It is good to know it should solve the problem. Perhaps I have a configuration issue in that case. Are you available for hire to consult via screen share by any chance? – SSS Jun 28 '17 at 22:36
  • Unfortunately I'm not available to hire, but I will help you anyway. Can you create an issue in the Linkit issue queue and provide me with the your Linkit profile configuration. Please also make sure that you are using the lastest version of Linkit 8.x-5.x. (Linkit 8.x-5.0-beta5) – BratAnon Jun 29 '17 at 6:57
  • @BratAnon Can this also be used in conjuction with Pathologic module ? or does it replace the functionality of Pathologic ? – GiorgosK May 18 '18 at 10:53
  • @BratAnon I tried linkit ckeditor but unable to link to views pages. Is there workaround for that ? – Fahad Ur Rehman Jan 25 at 7:28
0

Whilst it's great that Linkit is adding support for this, you may still have issues with broken links, especially from external sources.

The redirect module handles this by adding a redirection everytime the path for a piece of content changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.