0

I have Pathauto which changes node/[nid] to having a path of [title]; I then use subpathauto to change node/[nid]/edit to [title]/edit.

But now how can I change the edit fragment? I want to change all instances of edit to update. so the URLs would be [title]/update instead of [title]/edit.

I cannot use arguments or wildcards in Pathauto, so I cannot specify a path like */*/edit to be */*/alter, but that is effectively what I would like to happen.

  • Why would you want to implement a change that will confuse the succeeding developers who will potentially work on the same project by modifying a widely-known Drupal convention? – Randell Apr 13 '14 at 23:49
  • 1
    I would also advise against changes that don't seem to add any value, but have to potential to introduce problems. Other modules will assume that the edit path is node/[nid]/edit so you could break other things, it could confuse any users who have prior experience with drupal, and as mentioned it could confuse future developers (although if coded properly and documented this should be avoidable). – rooby Apr 14 '14 at 1:54
2

I think this is a legit request as long as you add an additional alias as opposed to overwriting system paths.

I would implement hook_node_insert() and then use path_save() to set your custom edit path on node creation. You will also probably need to make sure that this hook runs after the Pathauto module has set its path, so you can use the alias it sets as part of your additional edit alias.

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.