Create media asset from content edit form

Video creator
Salsa Digital

Disclaimer: The content in this video remains relevant to Drupal 10 customers. An updated version of this training video is in the works and will be available soon.

Transcript

Introduction

Welcome to the GovCMS Content Administration Training series. Hi, I’m Ivan from Salsa Digital and in this video,  you’ll learn how to create media assets from the content edit form

We’ll cover the following two topics:

  • How to create or reuse assets directly from the content edit form
  • How to categorise assets using tags

Create and manage assets from content form

So far we’ve looked at how to create assets from this Media page. You know how to create individual ones by clicking on Add media and how to bulk upload them by using the bulk upload feature. 

Now let’s look at how to upload and manage assets directly from the content edit form, because this is honestly how you’ll manage most assets — by uploading them while content is being created. 

Let’s go ahead and create a standard page. Click on Content, then Add content, then click on Standard page and I’ll enter “About us” in the title field.

On a Standard page, an asset can be created or selected via the Thumbnail, Attachments or Featured image fields.

Now your Standard page content form could look a little different. You could have more or fewer fields. But the out-of-the-box Standard Page should have a: 

  • Thumbnail field, for selecting images that will be used for the page thumbnail
  • Attachments field, where you can select which files will be listed at the bottom of the page (only document file types can be uploaded such as PDFs or Word documents) 
  • Featured image field, which lets you add a featured image at the top of the page

Uploading a featured image

Let’s go ahead and add a featured image. 

Click on “Select image(s)”, on the “Featured image” field. From the library tab, you can see all the existing image media assets, and you can filter by name or tag. But if you want to reuse an existing asset as the featured image, just select it by checking the box, then scroll down to the bottom and click on Select image. But in this example, let’s go ahead and upload a new image, so click on the Upload tab. Here you can upload an image by clicking on Select files, or simply by dragging the file into this area. Let me just go and select an image. 

Enter in a name for the asset, and alternative text then click on Select image(s). At this point, we have uploaded the file, created the media asset and attached it to the Featured image field. And if we go to the Media page, we should see the asset we just created. So I’ll click on Content and open it in another tab, then go to Media and…here is the asset we just created. 

Let’s go back to the Standard page that we were working on, make sure there is a title and a featured image and then click on Save.

Changing a featured image

Now if we want to change the featured image, click on Edit, then click Remove on the image. This will not delete the asset, it’ll simply remove it from this field and no longer use it as the featured image. But it won’t delete the asset, so it’s safe to click on Remove.

Then click on Select image, and this time let’s find the “Featured image” example. And we can filter by the name, so I’ll enter in “Featured image” and click on Apply. So here is the image and I’ll select it by checking the box and click on Select image.  And then if I click on Save we have a new “Featured image” and this asset can be used on multiple pages.

Let’s go back and edit the about us page again.

Different fields

Now creating or selecting a media asset on any of these three fields — Thumbnail, Attachments and Featured image — is exactly the same. The user interface is the same. If we click Select image on the Thumbnail field, you have the Library tab where you can filter and select assets, then you have the Upload tab, where you can upload and create assets. If we click Select file on the Attachments field, we have the same tabs: Library (for filtering and selecting) and Upload. The only difference between the Attachments field and the Thumbnail and Featured image field is that Attachments will only let you select File media types, such as PDFs and Word documents. Whereas, the other two fields, Thumbnail and Featured image will only allow you to select or upload an image.

Tagging assets

Now, before we move onto other things, let’s learn how to tag and categorise media assets. Because you may have noticed that we have the ability to filter by tags as well as name. Tagging your media is very simple. 

Let’s go and edit a few media assets. Go to Content, Media. I’ll go ahead and tag a few of these example images. I’ll edit this image and add the tag of Example, and I’ll do another. 

Now let’s go back to the About us page, and if we click on Select image on the Thumbnail field, we can now filter the assets by the tag name “Example”. Now we can see the two assets that have been tagged. 

Tagging your assets will help you organise and categorise your media assets because as time goes on so does the amount of images that get uploaded.  And this is a nice way to group and find them.

Recap

Let’s now recap what we covered in this video. First, you learnt how to create and reuse assets within the content edit form. Then you learnt how to categorise assets by tagging them.