Problem/Motivation

Most areas where we are configuring and then creating structure, like menus and taxonomy vocabularies, have action buttons where we can both make edits to the configuration and list the entries that apply. This doesn’t currently happen with content itself.

Proposed resolution

To place a further secondary action in the action button on each content type, named “List content” which directs the user to admin/content with a filter for the content type already applied. See screenshot as example

“Screenshot

Remaining tasks

Create Patch

User interface changes

Adding a further action to the action button as described above.

API changes

none

Data model changes

none

Comments

rachel_norfolk created an issue. See original summary.

rachel_norfolk’s picture

Issue tags: +DevDaysMilan
pguillard’s picture

Assigned: Unassigned » pguillard
pguillard’s picture

Assigned: pguillard » Unassigned
Status: Active » Needs review
StatusFileSize
new24.42 KB
new865 bytes

Here is a first patch.

A few remarks :

  1. I did that in Drupal\Core\Entity\EntityInterface\NodeTypeListBuilder to target node entities, but this could be generalized at a higher level for all kind of entities, in Drupal\Core\Entity\EntityListBuilder
  2. I would suggest
    List content

    instead of

    List {node type} content

    , like the labels we have elsewhere ('List terms'), otherwise we can not guarantee the buttons width. As an example :
    resulting operations

  3. Any suggestion is welcomed !
rachel_norfolk’s picture

Status: Needs review » Needs work

Oh I like this!

Code looks good to me and it is achieving the intended goal.

+++ b/core/modules/node/src/NodeTypeListBuilder.php
@@ -47,6 +47,18 @@ public function getDefaultOperations(EntityInterface $entity) {
+    if ($entity->access('access administration pages')) {

As the user must have this permission already to see the button anyway, maybe it would be better to check for the permission "Access the Content overview page” instead as that is the target page we are looking to display?

pguillard’s picture

Status: Needs work » Needs review
StatusFileSize
new870 bytes
new594 bytes

@rachel_norfolk, update with suggested permission

rachel_norfolk’s picture

Status: Needs review » Needs work
+++ b/core/modules/node/src/NodeTypeListBuilder.php
@@ -47,6 +47,18 @@ public function getDefaultOperations(EntityInterface $entity) {
+    if ($entity->access('Access the Content overview page')) {

erm - I’m sorry - I sent you the “human name” of the permission, not the machine name - I think I is meant to be "access content overview”

This has the effect that, for a user without the "access content overview” permission, they still get the entry in the action button but they see an access denied area when following it.

pguillard’s picture

Status: Needs work » Needs review
StatusFileSize
new861 bytes
new590 bytes

I'm sorry, my fault, my shame.
Here is a new patch

rachel_norfolk’s picture

StatusFileSize
new903 bytes
new720 bytes

I *think* $entity->access('access content overview') and not giving us something that checks the user’s permission. We can do that more simply with

$user = \Drupal::currentUser();
    if ($user->hasPermission('access content overview')) {}

Updated patch attached, including that change and does add/remove the action correctly.

Also - a bit of pair programming on this with balagan - who should be credited.

balagan’s picture

Thanks for mentioning me, happy to help!

pguillard’s picture

In the train for Firenze, I let you the remaining work! See you next time !

pguillard’s picture

I would say RTBC +1, but I guess I should not make it.

Anonymous’s picture

Tested OK using the magic simplytest.me link.

Not sure what the process for UI advancements is on the semantic releases of core but my initial instinct is this should be the first option on the list to keep it consistent with the other area mentioned, taxonomy, instead of half way down the list. 'View' is generally the first option - just because it wasn't before doesn't mean that should necessarily set a precedent.

my 2p

Anonymous’s picture

Issue summary: View changes
StatusFileSize
new21.09 KB

Drat, now I'm thinking all sorts about this consistency thing!

  1. As @pguillard noted in #4 including the content type will provide unexpected results in different screens, silly long content type labels, etc. so agree it should be just 'List content', which although a little ambiguous, when in context on the screen it should be understandable
  2. Menus & Taxonomy both have 'Add' options, if we are to be consistent then have 'Add content' option too
  3. 'Edit' should change to 'Edit content type' if the others are 'Edit menu' and 'Edit vocabulary'
  4. 'Delete' is on content type but not Menus & Taxonomy
  5. Taxonomy seems to be the most logical order - List, Edit, Add, Manage fields, Manage form display, Manage display - Content Types is ordered almost the opposite way round
  6. Menus doesn't have a 'List menu items', the screen you end up on after clicking 'Edit menu' lists the menu items but it's not obvious it does. I seem to remember the edit menu and list screens were merged a while back, not sure how this affects permissions - can't remember if you can split out permission to be able to manage the menu itself and manage the menu items

I guess there's a few issues that could be split out from that list - I like the idea of adding this 'List content' option, and if we're going to focus on consistency then let's not just add more options but raise to "let's make the admin UI as consistent as possible", at the moment it seems a little jumbled.

Anonymous’s picture

Ah, I forgot there's a "referencing issue", it's been a while since I used the issue queues ;)

Two points for this specific issue still apply:

  1. As @pguillard noted in #4 but doesn't seem to be addressed is including the content type will provide unexpected results in different screens, silly long content type labels, etc. so agree it should be just 'List content', which although a little ambiguous, when in context on the screen it should be understandable
  2. Still think it should be the top item on the drop-down
pguillard’s picture

As I agree with @stevepurkiss suggestions at #15, I applied them here.

Anonymous’s picture

Issue summary: View changes
StatusFileSize
new57.26 KB

Thanks - patch applies well, works fine, looks good to go!

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

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now 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.

pguillard’s picture

@stevepurkiss, thanks for this review

Status: Needs review » Needs work

The last submitted patch, 16: add_list_content_action_link-11320921-16.patch, failed testing.

The last submitted patch, 16: add_list_content_action_link-11320921-16.patch, failed testing.

pguillard’s picture

Status: Needs work » Needs review
pguillard’s picture

Seems this is a bot failure ?

rachel_norfolk’s picture

Issue summary: View changes
rachel_norfolk’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

Update issue summary screenshot to one that reflects final patch and mark RTBC

rachel_norfolk’s picture

Issue summary: View changes

all very well changing the screenshot but you have to remember to change the text, too, Rachel!! :blush:

xjm’s picture

Title: List content filtered by content type as action on content type - consistency » Add "List content" operation to the content type administration page
xjm’s picture

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

This is an adding an additional option in a difficult UI. While I think it probably will help people who are trying to view their content for the content types and end up on this page, we should have a usability maintainer verify the change, since there is a tradeoff whenever we add new options. So tagging for usability review.

Also, it's best to include before and after screenshots (not just the after screenshot) so that reviewers can compare them side by side.

Thanks everyone!

Bojhan’s picture

Issue tags: -Needs usability review

I am not convinced this is a good idea. We want to clearly separate listing UI's from editing UI's. We don't have this pattern elsewhere, and if we do we make the Name link to the relevant object. I am therefore unsure, if we should continue with this path of duplication. I like the connecting the dots, but we need to evaluate a consistent approach to it - not a one off.

rachel_norfolk’s picture

Actually, the reason we raised the issue in the first place was because other, similar things DO have their content listings linked in the same way. Taxonomy terms can be listed from the vocabulary structure pages. Menu items can be listed from the menu structure pages. Really, what we are trying to do here is being more consistent, not less.

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.

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.

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.

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.

vikashsoni’s picture

StatusFileSize
new57.26 KB

Applied patch working fine sharing screenshot ...

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.

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.

ranjith_kumar_k_u’s picture

StatusFileSize
new842 bytes
new605 bytes
asha nair’s picture

StatusFileSize
new12.58 KB
new11.05 KB

Applied patch #43 , and it works fine in Drupal 9.5.x. Adding screenshots for reference

Manibharathi E R’s picture

StatusFileSize
new129.69 KB
new130.64 KB

Patch #43 tested and Applied successfully on Drupal 9.5.x.

Bushra Shaikh’s picture

Assigned: Unassigned » Bushra Shaikh
Bushra Shaikh’s picture

Assigned: Bushra Shaikh » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new61.69 KB
new63.05 KB

Verified and tested patch#43 on drupal 9.5.x-dev. Patch applied successfully.

Testing Steps:

  1. Install drupal 9.5.x-dev version.
  2. Go to admin/structure/types
  3. Check Operations it is labeled as " Manage fields"
  4. Apply patch.
  5. Clear the cache and reload the page.

Test Result:
After applying the patch Manage fields label has been changed to "List content".

Can be moved to RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests, +Needs usability review

We should add test coverage that the link works and only lists content of the expected type.

Also #29 @Bojhan of the usability team said that they were not convinced this was a good idea. This was challenged by @rachel_norfolk in #30 but I'm not sure that there has been an resolution. Going to tag for the usability team to reconsider this one.

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.

aaronmchale’s picture

Issue tags: -Needs usability review

We reviewed this issue at #3314117: Drupal Usability Meeting 2022-10-14, that issue will have a link to the recording.

For the record the participants were: myself, @benjifisher, @rkoller, and @simohell.

We agreed with the overall idea that providing a way to easily access the relevant list of content is a positive change, however we felt that adding this link under the operations was not appropriate, mainly because:

  1. Everything under operations takes you to a page which sits under the specific content type, both in terms of the Breadcrumb and URL, so from an IA (Information Architecture) perspective, the user remains within the same part of the structure.
  2. Similarly, everything under Operations also has a corresponding Local Task.
  3. Therefor, by placing this link under the Operations drop-down, we would be creating a confusing experience, where the "List" link takes the user to a completely separate part of the admin UI, while all the other operations keep the user within the same area of the admin UI - a "sub-page" of that specific content type if you will. By not using the Operations links, we ensure that navigating back or between operations using the breadcrumb and local tasks is consistent across operations.

To address the point about precedent: What we are doing here is different to the previously mentioned examples of Menu and Taxonomy, where in those cases the "List" operation does not take you to a completely different part of the admin UI, the user remains within that part of the admin UI and still has access to the same Local Tasks and Breadcrumb when on the "List" page. If we were doing a like for like implementation, then we could use that existing precedent, however that is not the case here.

We also noted that Menu is not a good example because the List is presented on the Edit form, which results in the one form trying to do too many things and creates a poorer user experience than if the List and Edit form were on two separate tabs/pages; But that's for a different issue.

Instead, what we are proposing is to add a new column, to the left of the Operations column, which contains the proposed link. We also felt that it would be useful to have the link text indicate how many content items each content type has. This approach has the added advantages of:

  1. Allowing the user to see, at a glance, how many items each content type has; This could be useful if the user wants to delete a content type and so can easily see if there are any remaining content items, this could help to prevent accidental deletion where the user didn't realise that the content type still has some content.
  2. We considered whether appending this count and link to the Name column was a good idea, but concluded that a dedicated column would be better, as it is then easier to scan down the number of content items. Typically, numbers are easier to scan and parse if they are all aligned consistently.
  3. For sites with large number of content types, a dedicated column further aids in making the information easier to scan and parse.

We did not have an opportunity to make any specific text/wording recommendations during this meeting, however general guidance would be:

  1. Keep it short, less is more; By adding a new column we're reducing the space available to the description column, so we should aim for as small a width as possible.
  2. We need to communicate both the number of items but also that by clicking the link the user is taken to a different part of the admin UI.

I'm removing the Usability Review tag, but feel free to add it back when these recommendations have been implemented, the group can then review the proposed solution/text. At that point, please ensure there are up to date screenshots in the issue summary.

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.

acbramley’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: -Needs tests

I'm not actually sure if there's a good way to achieve this. For example, what happens if a user changes the key of the type filter in the Content view? Those links would now be broken.

As per #50 it doesn't look like we should go with the operation so I'm removing the Needs tests tag since we'd need a new solution.

acbramley’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Closing this as won't fix based on #50 and #52

If anyone feels strongly that this should be implemented and has a way around the limitations mentioned, feel free to reopen this.

xjm credited benjifisher.

xjm credited rkoller.

xjm credited simohell.

xjm’s picture

For #52, how this works with other types is that there is an entity list handler that provides the link, which is then overridden by the view. If the view is altered to no longer provide the operation, then it would fall back to the basic handler (I think).

That said, I'm also a bit skeptical of the proposed alternate approach, and of introducing a new pattern just for this; a separate column seems equally problematic to an operation link for me. So (committer hat on) I also agree with the wontfix here, given that there isn't a clear UX win. If we want to close the loop for site administrators on this somehow, we should probably start from scratch with design.

Adding credits from the usability meeting and for various reviewers and maintainers.

Thanks everyone!