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:
Before

After, including contrib tabs:
After

API changes

- (?)

CommentFileSizeAuthor
#65 Screenshot -.-after.png321.01 KBambikahirode
#65 Screenshot .-after.png458.03 KBambikahirode
#65 Screenshot -.-before.png422.4 KBambikahirode
#64 simplified-1368140-64.patch902 bytesxpersonas
#61 1368140--after--patch--pic.png32.56 KBvikashsoni
#61 1368140--before--patch--pic.png37.53 KBvikashsoni
#58 interdiff_57-58.txt1.11 KBraman.b
#58 1368140-58.patch3.63 KBraman.b
#57 interdiff_56-57.txt1.45 KBraman.b
#57 1368140-57.patch3.6 KBraman.b
#56 1368140-56.patch1.97 KBabhijith s
#48 45-48-interdiff.txt2.46 KBdaniel.bosen
#48 improve_user_experience-1368140-48.patch3.64 KBdaniel.bosen
#45 interdiff-1368140-36-45.txt2.31 KBdaniel.bosen
#45 improve_user_experience-1368140-45.patch4.52 KBdaniel.bosen
#41 Screen Shot 2018-01-27 at 7.36.21 PM.png60.76 KBltrain
#37 screenshot-media.png79.37 KBdaniel.bosen
#37 interdiff-1368140-29-36.txt1.43 KBdaniel.bosen
#37 improve_user_experience-1368140-36.patch3.2 KBdaniel.bosen
#30 order_1368140_30.png27.95 KBmtodor
#29 1368140-28-29.diff.txt3.44 KBchr.fritsch
#29 improve_user_experience-1368140-29.patch2.83 KBchr.fritsch
#28 interdiff-1368140-20-28.txt887 byteschr.fritsch
#28 improve_user_experience-1368140-28.patch2.92 KBchr.fritsch
#28 before-contrib.png30.62 KBchr.fritsch
#28 after-contrib.png28.86 KBchr.fritsch
#25 metatag-simple-sitemap.png159.5 KBchr.fritsch
#20 url-alias-first.png91.9 KBchr.fritsch
#20 interdiff-1368140-14-20.txt481 byteschr.fritsch
#20 improve_user_experience-1368140-20.patch2.78 KBchr.fritsch
#18 url-alias-in-vertical-tab.png30.65 KByoroy
#17 after-path.png97.84 KBchr.fritsch
#17 after-relations.png105.83 KBchr.fritsch
#17 before.png93.35 KBchr.fritsch
#14 improve_user_experience-1368140-14.patch2.69 KBchr.fritsch
#10 1368140-10-improve-taxonomy-term-edit-page.patch2.47 KBtemkin
#7 1368140-7-improve-taxonomy-term-edit-page.patch2.42 KBtemkin
#6 1368140-6-improve-taxonomy-term-edit-page.patch2.7 KBtemkin
#1 term-page-no-vtabs.png69.45 KBjenlampton

Issue fork drupal-1368140

Command icon 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

jenlampton’s picture

StatusFileSize
new69.45 KB

Here's a screenshot of what the term page looks like with extra fields - and no vertical tabs.

xjm’s picture

Added this issue to the summary at #1347448: [META] Taxonomy admin usability Improvements.

xjm’s picture

Issue summary: View changes

specify which field

jibran’s picture

Issue summary: View changes
Issue tags: +Needs design, +Usablity

Why not make it two column while we are at it just like node?

xjm’s picture

Title: Implement vertical tabs on the taxonomy/term/X/edit page » Improve user experience of the taxonomy/term/X/edit page

#3 sounds interesting, so broadening the scope to include that as a potential solution.

jibran’s picture

Ok so we can add vertical tabs in Drupal\taxonomy\TermForm::form and write seven_form_taxonomy_term_form_alter to replicate seven_form_node_form_alter

temkin’s picture

Status: Active » Needs review
StatusFileSize
new2.7 KB

I'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.

temkin’s picture

Noticed a small issue in the previous patch. Corrected and uploaded a new version.

The last submitted patch, 6: 1368140-6-improve-taxonomy-term-edit-page.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 7: 1368140-7-improve-taxonomy-term-edit-page.patch, failed testing.

temkin’s picture

Fixed the typo. New patch attached.

temkin’s picture

Status: Needs work » Needs review

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

chr.fritsch’s picture

Version: 8.2.x-dev » 8.3.x-dev
StatusFileSize
new2.69 KB

I rerolled the patch, to work against 8.3.x

mtodor’s picture

Status: Needs review » Reviewed & tested by the community

I have tested and reviewed patch provided at #14. It's fine. Nice work!

alexpott’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs screenshots

I would have expected an rtbc to have screenshots and some usability review.

chr.fritsch’s picture

Issue tags: -Needs screenshots +Needs usability review
StatusFileSize
new93.35 KB
new105.83 KB
new97.84 KB

Ok, as requested from @alexpott, here are some screenshots

Before:
before

After:
after-path
after-relations

yoroy’s picture

Issue tags: -Needs usability review
StatusFileSize
new30.65 KB

Hmm, 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!)

screenshot showing url alias in vertical tab, with summary

yoroy’s picture

Status: Needs review » Needs work

right…

chr.fritsch’s picture

Status: Needs work » Needs review
StatusFileSize
new2.78 KB
new481 bytes
new91.9 KB

@yoroy: Thanks for the review

Here is a new patch, where the path settings are first.

Url alias first

mtodor’s picture

Status: Needs review » Reviewed & tested by the community

I have tested new changes and order is correct now.

yoroy’s picture

Thanks! 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 :-)

jibran’s picture

@yoroy any comments on #3?

temkin’s picture

Sitemap XML and Metatag are 2 examples of modules that add additional vertical tabs to the term edit page.

chr.fritsch’s picture

StatusFileSize
new159.5 KB

Here you can see how it looks with metatag and simple_sitemap enabled

Metatag

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

Thanks 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.

chr.fritsch’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update
StatusFileSize
new28.86 KB
new30.62 KB
new2.92 KB
new887 bytes

Ok, 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.

chr.fritsch’s picture

This 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.

mtodor’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new27.95 KB

Interdiff 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.

Order for patch #29

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 29: improve_user_experience-1368140-29.patch, failed testing.

sudhanshug’s picture

Status: Needs work » Reviewed & tested by the community

The patch works fine when tested. Back to RTBC. Maybe CI error in #31

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs design

#3 was addressed by #18 so removing the Needs design-tag.

  1. +++ b/core/modules/path/path.module
    @@ -37,27 +37,47 @@ function path_help($route_name, RouteMatchInterface $route_match) {
    +    '#weight' => -2,
    

    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.

  2. +++ b/core/modules/path/path.module
    @@ -37,27 +37,47 @@ function path_help($route_name, RouteMatchInterface $route_match) {
    +function path_form_node_form_alter(&$form, FormStateInterface $form_state) {
    ...
    +function path_form_taxonomy_term_form_alter(&$form, FormStateInterface $form_state) {
    

    This might be easier to read if the form targeting would be done inside one form alter using the form_id.

  3. +++ b/core/modules/path/path.module
    @@ -37,27 +37,47 @@ function path_help($route_name, RouteMatchInterface $route_match) {
    + * Implements hook_form_BASE_FORM_ID_alter() for taxonomy_term_form().
    

    This comment is referring to a non-existing function

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

daniel.bosen’s picture

Assigned: Unassigned » daniel.bosen
daniel.bosen’s picture

Status: Needs work » Needs review
StatusFileSize
new3.2 KB
new1.43 KB
new79.37 KB

I 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.

daniel.bosen’s picture

Assigned: daniel.bosen » Unassigned
k4v’s picture

This also fixes https://www.drupal.org/node/2939583. We discussed these two issues @globalsprintweekend.

k4v’s picture

The patch is also reviewed over here: https://www.drupal.org/project/drupal/issues/2939583 :)

ltrain’s picture

StatusFileSize
new60.76 KB

As @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.

k4v’s picture

Status: Needs review » Reviewed & tested by the community
larowlan’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/path/path.module
@@ -38,27 +38,57 @@ function path_help($route_name, RouteMatchInterface $route_match) {
+/**
+ * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\media\MediaForm.
+ */
+function path_form_media_form_alter(&$form, FormStateInterface $form_state) {
+  path_entity_form($form, $form_state);
+  $form['advanced']['#default_tab'] = 'edit-path-settings';
+  $form['path_settings']['#weight'] = -2;
+}

this 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

larowlan’s picture

Issue tags: +Needs tests

Also - we need tests here

Thanks folks!

daniel.bosen’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new4.52 KB
new2.31 KB

Removed the media stuff and added a test to verify, that the URL alias input is the first tab in the vertical tabs menu.

temkin’s picture

Status: Needs review » Reviewed & tested by the community

The patch from #45 looks good.

catch’s picture

Status: Reviewed & tested by the community » Needs review
+++ b/core/modules/path/path.module
@@ -38,27 +38,48 @@ function path_help($route_name, RouteMatchInterface $route_match) {
+function path_entity_form(array &$form, FormStateInterface $form_state) {

Could 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?

daniel.bosen’s picture

StatusFileSize
new3.64 KB
new2.46 KB

If we want to refrain from introducing a non-hook, I guess renaming would not help much. So I duplicated the code in this patch.

k4v’s picture

Maybe this is also a duplicate of
https://www.drupal.org/project/drupal/issues/2916809?

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

abhijith s’s picture

Patch #48 can't be applied on 9.2.x.Needs reroll

Checking patch core/modules/path/path.module...
error: while searching for:
  $form['path']['#group'] = 'path_settings';
}

/**
 * Implements hook_entity_base_field_info().
 */

error: patch failed: core/modules/path/path.module:59
error: core/modules/path/path.module: patch does not apply
Checking patch core/modules/path/tests/src/Functional/PathTaxonomyTermFormTest.php...
Checking patch core/modules/taxonomy/src/TermForm.php...
error: while searching for:
    $form_state->set(['taxonomy', 'parent'], $parent);
    $form_state->set(['taxonomy', 'vocabulary'], $vocabulary);

    $form['relations'] = [
      '#type' => 'details',
      '#title' => $this->t('Relations'),
      '#open' => $vocabulary->getHierarchy() == VocabularyInterface::HIERARCHY_MULTIPLE,
      '#weight' => 10,
    ];

    // \Drupal\taxonomy\TermStorageInterface::loadTree() and

error: patch failed: core/modules/taxonomy/src/TermForm.php:25
error: core/modules/taxonomy/src/TermForm.php: patch does not apply

abhijith s’s picture

StatusFileSize
new1.97 KB

Rerolled patch #48 for 9.2.x .Please check

raman.b’s picture

StatusFileSize
new3.6 KB
new1.45 KB

The reroll in #56 didn't include the test added in #45

raman.b’s picture

StatusFileSize
new3.63 KB
new1.11 KB

Addressing the deprecations

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

StatusFileSize
new37.53 KB
new32.56 KB

Applied #56 patch in durpal-9.3.x-dev applied successfully
Thanks for the patch
for ref sharing screenshot ...

anybody’s picture

Still relevant for the usability and consistency of Drupal 9+!

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

xpersonas’s picture

StatusFileSize
new902 bytes

I 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?

ambikahirode’s picture

StatusFileSize
new422.4 KB
new458.03 KB
new321.01 KB

patch in #64 applies cleanly working fine on local 9.5

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Category: Task » Feature request
Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

If #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!

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

meeni_dhobale made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.