Problem/Motivation
Since terms are now fieldable just like nodes, it would be useful to have vertical tabs here to hide the non-essential elements on the form. For example, the pathauto module provides fields for both the node form and the term form, but where the URL alias field can be nicely tucked away on the node form in vertical tabs, there's no similar interface pattern for terms.
Proposed resolution
- Implement vertical tabs to the taxonomy term edit form.
Remaining tasks
- Implement vertical tabs to the taxonomy term edit form.
User interface changes
- Vertical tabs on the term edit page
Before, including contrib tabs:

After, including contrib tabs:

API changes
- (?)
| Comment | File | Size | Author |
|---|---|---|---|
| #65 | Screenshot -.-after.png | 321.01 KB | ambikahirode |
| #65 | Screenshot .-after.png | 458.03 KB | ambikahirode |
| #65 | Screenshot -.-before.png | 422.4 KB | ambikahirode |
| #64 | simplified-1368140-64.patch | 902 bytes | xpersonas |
| #61 | 1368140--after--patch--pic.png | 32.56 KB | vikashsoni |
Issue fork drupal-1368140
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
jenlamptonHere's a screenshot of what the term page looks like with extra fields - and no vertical tabs.

Comment #2
xjmAdded this issue to the summary at #1347448: [META] Taxonomy admin usability Improvements.
Comment #2.0
xjmspecify which field
Comment #3
jibranWhy not make it two column while we are at it just like node?
Comment #4
xjm#3 sounds interesting, so broadening the scope to include that as a potential solution.
Comment #5
jibranOk so we can add vertical tabs in
Drupal\taxonomy\TermForm::formand writeseven_form_taxonomy_term_form_alterto replicateseven_form_node_form_alterComment #6
temkin commentedI've just created a patch for the same issue but for D7 a few weeks ago:
https://www.drupal.org/node/2650700
Here is a patch for D8. #3 makes perfect sense, but it's something that needs to be done in a classy theme as seven utilizes its templates, and term edit page has a different template than node edit page there. I think we can address that in a separate patch. For now, I've just updated Taxonomy term edit form to have vertical tabs and also updated path module to have its own vertical tab just like it has on a node edit form.
Looking forward for your review and hopefully merge. Thanks.
Comment #7
temkin commentedNoticed a small issue in the previous patch. Corrected and uploaded a new version.
Comment #10
temkin commentedFixed the typo. New patch attached.
Comment #11
temkin commentedComment #14
chr.fritschI rerolled the patch, to work against 8.3.x
Comment #15
mtodor commentedI have tested and reviewed patch provided at #14. It's fine. Nice work!
Comment #16
alexpottI would have expected an rtbc to have screenshots and some usability review.
Comment #17
chr.fritschOk, as requested from @alexpott, here are some screenshots
Before:

After:


Comment #18
yoroy commentedHmm, this is not the busiest of screens, there are only 2 additional configuration options besides title and description. So I'm not sure it's a very worthwhile change, especially if we keep the current ordering. I would think the URL alias field is used more often than the Relations settings. With URL alias shown before Relationships, the URL alias would become the default open vertical tab.
In general I think it's still worthwhile to move these things over to vertical tabs, but then we should also be aware of what gets show in that first tab that is open by default.
So needs work for that: switch the order of URL alias and Relationships so that URL alias comes first.
(good to see that the actual URL alias gets added to the vertical tab summary, nice!)
Comment #19
yoroy commentedright…
Comment #20
chr.fritsch@yoroy: Thanks for the review
Here is a new patch, where the path settings are first.
Comment #21
mtodor commentedI have tested new changes and order is correct now.
Comment #22
yoroy commentedThanks! Tested again on simplytest and everything seems good.
Do we have examples of contrib modules that add things to this screen?
Also: #2847035: Remove useless descriptions on taxonomy term create/edit screen :-)
Comment #23
jibran@yoroy any comments on #3?
Comment #24
temkin commentedSitemap XML and Metatag are 2 examples of modules that add additional vertical tabs to the term edit page.
Comment #25
chr.fritschHere you can see how it looks with metatag and simple_sitemap enabled
Comment #27
xjmThanks for the screenshots! In the future, note that it's helpful to make your browser window small when taking screenshots and crop to only the relevant portion. This makes it easier to understand what is being changed and compare. See @yoroy's screenshots in #18 for a great example of a helpful screenshot. Also, it's always best to embed before and after screenshots in the issue summary in the UI changes section. Tagging for that issue summary update.
In #13, the URL path settings is not at the top again. I think we need better weights than the ones in the patch, or to actually mark it as the default vertical tab if that is possible (surely it is?), so that URL path settings really is at the top in most cases.
Comment #28
chr.fritschOk, i adjusted the the weights of URL path and relation to be really at the top. So if a contrib module will not define any weight, it will appear after the core tabs.
Additionally i made URL path to the default tab. So if a module defines a really low weight (lower -1), it well be at the top, but the URL path will still be open by default.
I also added screenshots to the issue summary.
Comment #29
chr.fritschThis needed a reroll because of #2776975: March 3, 2017: Convert core to array syntax coding standards for Drupal 8.3.x RC phase
I provide a normal diff, because it was not possible to create an interdiff.
Comment #30
mtodor commentedInterdiff is a bit broken, but it's not relevant.
I have tested patch provided in #29. It looks good, it can be applied, order is correct, URL path is selected by default. When modules provide additional vertical tabs they are appended to end. So everything looks good. Screenshot provided.
Comment #32
sudhanshug commentedThe patch works fine when tested. Back to RTBC. Maybe CI error in #31
Comment #33
lauriii#3 was addressed by #18 so removing the Needs design-tag.
Changing the weight causes some unexpected changes, such as that the order in other entity forms might change. This happens at least in the node form.
This might be easier to read if the form targeting would be done inside one form alter using the form_id.
This comment is referring to a non-existing function
Comment #36
daniel.bosenComment #37
daniel.bosenI moved the weight, as well as the default_tab, into the alter hooks. This enables the possibility to change those settings in different situations and gets us back the previous node form behaviour.
Since path_entity_base_field_info() handles now media as well, I added the corresponding media form alter hook, to have the same behaviour in media.
I like the approach better to have seperate form alter implamentations, espacially now with the different configurations, so I kept that for now.
Comment #38
daniel.bosenComment #39
k4v commentedThis also fixes https://www.drupal.org/node/2939583. We discussed these two issues @globalsprintweekend.
Comment #40
k4v commentedThe patch is also reviewed over here: https://www.drupal.org/project/drupal/issues/2939583 :)
Comment #41
ltrainAs @k4v posted, we reviewed the patch at https://www.drupal.org/project/drupal/issues/2939583 and I have now also reviewed taxonomy/term/x/edit and it looks good.
Comment #42
k4v commentedComment #43
larowlanthis is out of scope, the issue here is about terms, not media?
If we intend to combine the issues, can we rename this one and give it an appropriate scope.
Note I'd prefer this one to just touch taxonomy, and then the other one to be postponed on this.
That would be within our scope guidelines
Comment #44
larowlanAlso - we need tests here
Thanks folks!
Comment #45
daniel.bosenRemoved the media stuff and added a test to verify, that the URL alias input is the first tab in the vertical tabs menu.
Comment #46
temkin commentedThe patch from #45 looks good.
Comment #47
catchCould we call this path_entity_form_helper() or something? Not massively keen on adding a new non-hook procedural function to a module - we could probably just duplicate the code even?
Comment #48
daniel.bosenIf we want to refrain from introducing a non-hook, I guess renaming would not help much. So I duplicated the code in this patch.
Comment #49
k4v commentedMaybe this is also a duplicate of
https://www.drupal.org/project/drupal/issues/2916809?
Comment #55
abhijith s commentedPatch #48 can't be applied on 9.2.x.Needs reroll
Comment #56
abhijith s commentedRerolled patch #48 for 9.2.x .Please check
Comment #57
raman.b commentedThe reroll in #56 didn't include the test added in #45
Comment #58
raman.b commentedAddressing the deprecations
Comment #61
vikashsoni commentedApplied #56 patch in durpal-9.3.x-dev applied successfully
Thanks for the patch
for ref sharing screenshot ...
Comment #62
anybodyStill relevant for the usability and consistency of Drupal 9+!
Comment #64
xpersonas commentedI simplified the patch a bit. The other patch worked, but it was throwing the admins off having a "URL path settings" and "URL alias" tab. Not sure if there's a need for the "URL path settings" tab that I'm missing?
Comment #65
ambikahirode commentedpatch in #64 applies cleanly working fine on local 9.5
Comment #67
smustgrave commentedIf #64 is used it will need test cases.
Reviewing #58 which still applies cleanly to D10.1
Manually testing I can confirm I am seeing the tabs
But believe the testing should be expanded some. Currently it tests for the path-settings tab. Should also check for
1. The Relations tab -> that the weight and parent fields appear inside.
2. When URL alias field is hidden from form display I would want to see that no tab appears
Thanks!
Comment #69
mortona2k commented