filefield_paths module is very convenient for improving SEO for pictures uploaded in bulk.
https://www.drupal.org/project/filefield_paths
the module won't work correctly on Windows and needs a patch:
https://www.drupal.org/files/issues/2021-08-25/fix-windows-backslash_2858308_21_0.patch
use the dev-1.x version and apply the patch via composer:
"drupal/filefield_paths": "^1.x-dev@dev",
then
"extra": {
"enable-patching": true,
"patches": {
"drupal/filefield_paths": {
"fix-windows-backslash_2858308_21": "https://www.drupal.org/files/issues/2021-08-25/fix-windows-backslash_2858308_21_0.patch"
}
},
where the module is very nice, is that it allows custom paths to save the images to, as well as custom image file names, using tokens.
it can even use the individual ALT attribute the user set for pictures.
it could be something like:
path: gallery/[node:title]
filename: [node:field_image:alt].-.[file:ffp-name-only-original].-.[random:hash:md2].[file:ffp-extension-original]
don't forget to activate all three sanitation options:
Remove slashes (/) from tokens
Cleanup using Pathauto
Transliterate
the result can be something like
/galleries/cosplay/tokyo-2021-26/toshiaki-kawaii-costume-373545354.jpg
this is so NICE
- Log in to post comments
Comments