Drupal 9 Images, Videos and Files
To add an image
In a WYSIWYG menu, click on the 'Insert Media' icon.
You then select and upload the image, and add any caption needed.
Alternatively, you can add media when editing content directly through the "Add Image Embed" or "Add Video Lightbox" paragraph types.
To update an image:
> 'Media Library'
> Find the Media
> Click 'Edit' (Pencil Icon)
> Click 'Remove' (this will remove the old image)
> Upload the new updated image
> Click 'Save'
> Then 'Rebuild Cache' to clear cache on the website (icon on the top upper right of your window)
This method won’t work if an <img> tag is used in HTML to connect the media, or if an image/media/pdf is added via copying the URL. Since Drupal 9 includes the YEAR and MONTH in the URL when the image/media/file is manually uploaded, so the URL changes when you later upload an updated image/media/file manually. So you need to update your links to the new URL. See sections below on 'Copy file URL' and 'Update a file' .
Logo Images:
To Add Videos
To add a file
First upload the file, then copy out the URL to paste into the link on your web page.
- To upload the file:
On the top 'Content' menu,
>hover over 'Media'
>hover over 'Add media'
>click on 'Document'
You then select and upload the document.
-Only one file is uploaded at a time.
-File size limit is 100 MB.
-Allowed files types are:
txt doc docx xls xlsx pdf
ppt pptx odp ods odt
- To copy the file URL:
At the top 'Content' menu
>hover over 'Media'
>click on 'Media library'
At the Media library, click on the top menu 'File'.
Click on the file that you uploaded and copy the URL.
On your webpage, select the text you want to link, click on the 'Link' icon in the WYSIWYG and paste in the URL.
Note that the year and month when the file was uploaded is included in the URL, so you have to change the webpage link if you upload a new version of the file (and delete the old file).
e.g., https://live-slac-lcls-d9.pantheonsite.io/sites/default/files/2023-06/save_publish.png
File_url.jpg
File URL (note that the year and month of when the file was uploaded is included in the URL)
Update a file
Since Drupal 9 includes the YEAR and MONTH in the URL when the file is uploaded, so the URL changes when you later upload an updated version of the file. So you need to update your links to the new URL.