Split off from #1751210: Convert URL alias form element into a field and field widget
Examples of how this would be useful:
- you don't want French content to have an en/ prefix nor the contributor bother to prefix it with fr/
- you want contributors to customize 'news' url, but it must begin with year/month/day/
- you want contributors to fully customize url of 'article' content (in this case specify an empty prefix for 'article' node type)
Proposed solution
-
Separate field instance settings for non-customizable URL alias prefix and user-customizable URL alias part/suffix:
-
Node add/edit form only allows user to customize the user-customizable URL alias part:
Comment | File | Size | Author |
---|---|---|---|
#8 | path.prefix.8.patch | 48.7 KB | sun |
#2 | pathauto-36-field-settings-auto.png | 11.45 KB | gaele |
#2 | pathauto-36-entity-add-edit.png | 12.15 KB | gaele |
Comments
Comment #1
gaele CreditAttribution: gaele commentedOK, one more time. Posted by @sun here: http://drupal.org/node/229568#comment-6684692
Add the field to any entity:
Edit the path field settings:
Later: Enable automatic aliases:
Add or edit an alias-field-enabled entity:
Comment #2
gaele CreditAttribution: gaele commented@sun, why do you have two separate steps 2 and 3? I'd imagine something like this:
2. Enable automatic aliases (tokens allowed in both "prefix" and "suffix"):
3. Add or edit an alias-field-enabled entity:
Comment #3
sunre: #2:
These were only separate screenshots to clarify that the new prefix does not depend on the Pathauto/Token functionality at all. In other words:
The separation into non-customizable and customizable part even makes sense without any automatically generated values.
The most simple use-case is a content type "News", and you just simply want all news nodes to share the URL alias prefix "news/" — that's a static value and does involve any tokens at all.
Comment #4
gaele CreditAttribution: gaele commentedOK, cool.
If so, in #1 step 3 why would you want to change the prefix that was set in step 2? What's the use case?
Comment #5
klonosJust to get things clear: this is postponed on #1751210: Convert URL alias form element into a field and field widget. Right? And this is bound to the D8 feature freeze (December 1st, 1-2 days time). Right?
Having this in would make things so easy/simple. Please do your best people. Thanx in advance.
Comment #6
renat CreditAttribution: renat commented@klonos, @Dries extended Feature Freeze date until February 18, 2013 for features, that shown substantial progress yet. Hope this feature will be considered eligible, as far as much work was done in http://drupal.org/node/1751210.
Comment #7
klonos@renat: yes, I just saw a reply from Angie in an issue with a link to Dries' announcement. That's great!! (...though I think that most of us following the core issues must have seen it coming).
Comment #7.0
sunUpdated issue summary.
Comment #8
sunJust to clarify that there is very sophisticated and working code for this issue already.
The changes were merely removed from the parent issue in order to achieve faster progress there.
Comment #9
nod_#8: path.prefix.8.patch queued for re-testing.
Comment #10.0
(not verified) CreditAttribution: commentedUpdated issue summary.
Comment #11
jibranRe-tagging.
Comment #12
klonosI would love it so bad if this feature gets in D8! ...or at least 8.1.0
Comment #13
andypostComment #14
dawehnerYeah this is certainly topic for a future release now.
Comment #30
smustgrave CreditAttribution: smustgrave at Mobomo commentedClosing as duplicate as I think effort should go into getting #229568: Pathauto in Core into core. Then that should cover this scenario too.
If anyone disagrees please reopen explaining why
Thanks!