Problem/Motivation
A bit like described in the Drupal 7 Alias Lock Module we often run into the situation that we have certain "static" content types, whose URL-aliases should be automatically created by pathauto, but never changed afterwards.
Of course this could be done manually by the author, but typically the content creators are no technical experts and tend to forget unchecking the "Generate automatic URL alias" after creating the node.
Typically, this is the case for nodes, which are an essential part of the menu structure or even more important, are parent paths to other URLs in a tree folder structure.
It would be nice to have an option, presumably on the pattern form (/admin/config/search/path/patterns/{CONTENT-TYPE}) to set this behavior.
Steps to reproduce
- Create an url pattern for nodes (e.g. page) with dynamic parts like
[node:title] - Create a node with a static nature (e.g. page) node, with automatic alias generation turned on. Let's set the title "My title"
- See the URL alias generated properly:
/my-title - Edit the node and change the title to "My new title" without thinking about the results in the URL and have
/my-new-titlegenerated as new title without noticing it - Argue about the wrong url structure and unwanted redirects, because "the only thing you wanted to to is changing the title" ;)
- Hope for an automatic solution, locking the URL after first creation by automatically unchecking "Generate automatic URL alias".
:)
Proposed resolution
Add an option to the pattern create / edit form (/admin/config/search/path/patterns/{CONTENT-TYPE})
Remaining tasks
- Discuss
- Implement
- Write tests
- Rewiew
- Release
Comments
Comment #2
anybody@Maintainers: What do you think about this? If you'd be fine with that, we'd start the implementation. :)
Comment #3
mably commentedCould be an interesting feature to have.
Some kind of "Auto generate once only".
Having that pattern flag would mean to toggle off the state after an automatic path alias generation.
Comment #4
anybodyIn the meantime I found https://www.drupal.org/project/node_keep
Maybe it should be linked on the module page. Looks like it solves this use-case?
Comment #5
mably commentedI think this feature could be implemented in-house.
We just need to find the right UX for it.