Attaching files to body text in Drupal 8
This is going to be a short artivle, I have been toying with Ansible, and there are some things I want to share in this site, let it be for other people to read it or let it be as a future reference for myself, playbooks start being too long and uncomfortable to just copy and paste code and now I need to be able to attach files (in the future we will see how make site look best, changing templates and blocks). ¡I have more ideas than time!
Since we are mond-ordered people, let us do it part by part:
Put site in maintenance mode:
drush sset system.maintenance_mode 1
Cowards do backups, unconcious people don't: (smart people have a backup policy)
tar -zcvf drupal.tar.gz /var/www/drupal/
pg_dump -U usuariobdd -b -f ficherodesalida.sql basedatosdrupal
We first update Drupal:
drush pm-update drupal
Then we install the module:
drush en editor_file
After that we set up the site into production mode:
drush sset system.maintenance_mode 0
After that we have the module installed and enabled, now we need to go to filter management (admin/config/content/formats) and the we choose which editor format will be allowed to attach files, be careful to not leave this open for non-authenticated users or for authenticated users if you have autoboarding enabled, there are a lot of wolves around the forest.
We configure the editor mode of our choice and add the clip button to editor:
And then we configure which file types are admitted, max sizes and the estile to be applied to the link.
Now it's time to test it:
¡And it works!