Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 18, 2022 04:25 am GMT

Naming files / Drupal 8

Netology has an excellent article on how to properly name files.

In short, all you need to do is:

  • Use only Latin letters and numbers;
  • Do not use capital letters;
  • Do not use spaces. Separate words with a dash;
  • Give meaningful names in English.

To perform the first three rules in Drupal 8 there is a module Transliterate filenames for uploads.

Install:

composer require drupal/transliterate_filenames ; drush en transliterate_filenames -y

Check:

    .jpg

kak_pravilno_imenovat_fayly.jpg

The module itself will replace uppercase letters with lowercase ones, spaces with underscores, and Cyrillic with Latin.

The only thing it won't do is that it won't translate the file name into English, so you'll have to keep an eye on this yourself.


Original Link: https://dev.to/vadimfilimonov/naming-files-drupal-8-5goi

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To