8000 Show usage in the Media view · Issue #298 · localgovdrupal/localgov_core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Show usage in the Media view #298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
willguv opened this issue May 13, 2025 · 13 comments
Closed

Show usage in the Media view #298

willguv opened this issue May 13, 2025 · 13 comments
Assignees

Comments

@willguv
Copy link
Member
willguv commented May 13, 2025

Is it possible to show usage on this page?

/admin/content/media

Mentioned at the images content group session

As a content designer
I want to see at a glance the media that isn't be used
So I can delete it from the site

@finnlewis
Copy link
Member

@ekes wonders if this could be done with a view column and https://git.drupalcode.org/project/media_entity_usage

@ekes
Copy link
Member
ekes commented May 15, 2025

Quick look, Media Entity Usage:

  • Does not have a Drupal 11 version.
  • Does not count any other entities referencing that nodes and paragraphs (so you could have a taxonomy term with an image for example).

@willguv
Copy link
Member Author
willguv commented May 15, 2025

We're blocked on this because the module is not Drupal 11 yet

@willguv willguv removed the status in 2025 Priorities May 15, 2025
@ekes
Copy link
Member
ekes commented May 15, 2025

Oh, in addition only counting nodes and paragraphs: I don't think this is going to count linkit media usage either. We just introduced that?

@ekes
Copy link
Member
ekes commented May 15, 2025

Ah that's better. We've got - now I remember the discussion about it going in!

https://www.drupal.org/project/entity_usage

which does count all of the above, and have a D11 release.
And has some views integration. Lemme look.

@willguv
Copy link
Member Author
willguv commented May 15, 2025

@ekes that's brilliant. If this is doable, I'd really like this in and usable by the end of May

@willguv willguv moved this to Ready in 2025 Priorities May 15, 2025
@ekes ekes transferred this issue from localgovdrupal/localgov May 15, 2025
@ekes
Copy link
Member
ekes commented May 15, 2025

Transfered to localgov_core as that's where localgov_media is at the moment. This override is going to be like the one to views.view.files.yml (see my comment about finding a better home for that #297 (comment) )

@ekes
Copy link
Member
ekes commented May 15, 2025

PR #299

@willguv
Copy link
Member Author
willguv commented May 15, 2025

Wow, fast! Thanks @ekes

As I can't install this right now, does this follow the same UX as paragraphs?

/admin/content/paragraphs

A column with "Used" as a heading, immediately to the left of the changed/ updated column?

@ekes
Copy link
Member
ekes commented May 15, 2025

Screenshot on PR. 'Usage count' is the title - can change that, if 'Used' is clear, it's shorter. Presently it's the last column before the dropdown - it could be between status and updated. Then the number is a link to the /media/{id}/edit/usage page.

@willguv willguv moved this from Ready to In Progress - Core team in 2025 Priorities May 15, 2025
@willguv willguv moved this from In Progress - Core team to Review in 2025 Priorities May 15, 2025
@willguv
Copy link
Member Author
willguv commented May 15, 2025

@ekes shall we follow same pattern as paragraphs?

  • Heading is 'Used'
  • Position is 3rd from right
Image

Do we allow sorting by used? Think we should

@ekes
Copy link
Member
ekes commented May 15, 2025

@willguv updated the view, and screenshot, on #299

@willguv
Copy link
Member Author
willguv commented May 15, 2025

Love it, thanks!!

finnlewis pushed a commit that referenced this issue May 20, 2025
* Admin media view with added usage column #298.

* Update hook for #298 if the view has not otherwise been changed.

* UI tweaks rename and move column #298 (comment)

* Allow sorting by count.

* Coding standards fixes.

* Further coding standards.

The return type for TranslatableMarkup still seems not to have been
fixed in core, so mildly irritating to have to decide it here.
@willguv willguv moved this from Review to Done in 2025 Priorities May 27, 2025
@willguv willguv closed this as completed by moving to Done in 2025 Priorities May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants
0