born05 / craft-assetusage
Adds a column to see which assets are used or unused.
Installs: 112 491
Dependents: 0
Suggesters: 0
Security: 0
Stars: 33
Watchers: 9
Forks: 8
Open Issues: 8
Type:craft-plugin
Requires
- php: ^8.2.0
- craftcms/cms: ^5.0.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-11-24 14:15:31 UTC
README
Adds a column to the assets overview to see which assets are used or unused. For Craft 4.
The "Usage" field shows all relations and the "Current Usage" field shows relations excluding revisions and deleted elements.
Setup
- Go to
admin/assets
- Click the "sprocket" icon
- Check the "Usage" or "Current Usage" column
- Save
- The assets table should now show a "Usage" or "Current Usage" column indicating usage
Settings
The setting values can be overridden from a PHP file within your project’s config/
folder, named assetusage.php
.
The file just needs to return an array with the overridden values:
<?php return [ 'includeRevisions' => false, 'renderUsedByInAssetDetail' => true, ];
Support
- Everything using an asset field or the relations table, including matrix fields
- SuperTable
Does NOT support (assets not connected through relations table)
- LinkIt
- Redactor
- ether/seo
Commandline usage
craft assetusage/default/delete-unused # Deletes all unused assets. craft assetusage/default/list-unused # Lists all unused assets.
License
Copyright © Born05
See license