2

I would like an input format that works roughly like this:

  • I can enter links to other pages on my site using a special syntax, but importantly, I reference them by their current URL alias.
  • When the page is saved to DB, the filter replaces them with node IDs, which never change.
  • If I edit the page again, the filter replaces them back with current URL aliases before showing it to me. That way I know what the links are and I don’t even have to care that the DB actually stores node IDs.
  • When the page is rendered, the links are rendered to the URL aliases, rather than node IDs.

Is there anything out there that does this already?

Why I want this: so that I can change URL aliases without breaking existing links. I do have automatic redirects created, but that's not quite the same thing. I want pages to link to the correct URL when I change an alias.

1
  • Yeah, I’ve always wanted that too. It’s so easy to implement and totally fixes the broken-links problem without that hack that is redirects...
    – Timwi
    Mar 1, 2012 at 0:02

1 Answer 1

0

If you use an wysiwyg editor ie. CKeditor, there are contrib modules that offer you this functionality. For example, take a look at the ckeditor link module. It let's you search for your nodes and make a link to the node path which is what is saved to your database. Drupal automatically shows the url alias frontend, so if you change your url alias at a later point, you will still have a working reference to your node.

Why is it important to you that you reference them by their current url alias?

1
  • When I want to link to a page, my browser shows its current alias. So it’s easiest if I can just use that, rather than find the node id. I’ll have a look at that module.
    – RomanSt
    Mar 9, 2012 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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