@@ -3,7 +3,7 @@ title: Media view
3
3
slug : media-view
4
4
description : null
5
5
date : 2022-11-28T14:55:04.221Z
6
- lastmod : 2023-04-01T13:53:45.580Z
6
+ lastmod : 2024-02-22T11:23:12.499Z
7
7
weight : 300.2
8
8
---
9
9
@@ -13,7 +13,7 @@ The media view has been created to make it easier to look at all media files ava
13
13
articles. When you click on an image, it will show a lightbox, so that it is easier to glance at
14
14
small images.
15
15
16
- ![ Dashboard - Media view - Lightbox ] [ 01 ]
16
+ ![ Media dashboard ] [ 01 ]
17
17
18
18
## Supported files
19
19
@@ -31,12 +31,69 @@ If you want that the media dashboard supports additional file types, you can def
31
31
]
32
32
```
33
33
34
+ ## Metadata
35
+
36
+ The media dashboard supports metadata for images. By default, the following metadata is supported:
37
+
38
+ - Title
39
+ - Caption
40
+ - Alternate text
41
+
42
+ Since version ` 10.0.0 ` , you can define your own metadata fields by defining media content types.
43
+
44
+ ### Media content types
45
+
46
+ Media content types are defined in the ` frontMatter.media.contentTypes ` setting. This setting allows
47
+ you to define your own metadata fields for your media files.
48
+
49
+ #### Media content type properties
50
+
51
+ | Property | Type | Description | Default |
52
+ | --- | --- | --- | --- |
53
+ | ` name ` | ` string ` | The name of the content type. | ` "" ` |
54
+ | ` fileTypes ` | ` string[] ` | The file extensions that should be associated with this content type. | ` [] ` |
55
+ | ` fields ` | ` field[] ` | The fields that should be shown for this content type. | ` [] ` |
56
+
57
+ #### Media field properties
58
+
59
+ | Property | Type | Description | Default |
60
+ | --- | --- | --- | --- |
61
+ | ` title ` | ` string ` | The title of the field. | ` "" ` |
62
+ | ` name ` | ` string ` | The name of the field. | ` "" ` |
63
+ | ` type ` | ` string ` | The type of the field (` string ` ). | ` "" ` |
64
+ | ` single ` | ` boolean ` | If the field is a single line value. | ` true ` |
65
+
66
+ ``` json {{ "title": "Example of defining media content types" }}
67
+ {
68
+ "frontMatter.media.contentTypes" : [{
69
+ "name" : " default" ,
70
+ "fileTypes" : [" png" , " jpg" , " jpeg" , " gif" ],
71
+ "fields" : [{
72
+ "title" : " Title" ,
73
+ "name" : " title" ,
74
+ "type" : " string"
75
+ },
76
+ {
77
+ "title" : " Author" ,
78
+ "name" : " author" ,
79
+ "type" : " string"
80
+ },
81
+ {
82
+ "title" : " Alt text" ,
83
+ "name" : " alt" ,
84
+ "type" : " string"
85
+ }
86
+ ]
87
+ }]
88
+ }
89
+ ```
90
+
34
91
## Media actions
35
92
36
93
On the image card, there are actions like setting metadata, copying the relative path, and deleting
37
94
the media file.
38
95
39
- ### Setting metadata
96
+ ### Updating metadata
40
97
41
98
Setting metadata got introduced so that you can set the description and alt tag of your images. This
42
99
functionality makes it easier to insert your images to your content.
@@ -77,9 +134,9 @@ your explorer/finder window into one of your folders.
77
134
![ Dashboard - Upload media file] [ 06 ]
78
135
79
136
<!-- Link References -->
80
- [ 01 ] : /releases/v5.9 .0/media-lightbox .png
81
- [ 02 ] : /releases/v5 .0.0/metadata-media .png
137
+ [ 01 ] : /releases/v10.0 .0/media-dashboard .png
138
+ [ 02 ] : /releases/v10 .0.0/metadata-update .png
82
139
[ 03 ] : /docs/markdown#insert-images
83
- [ 04 ] : /releases/v5.9 .0/media-deletion .png
140
+ [ 04 ] : /releases/v10.0 .0/delete-media .png
84
141
[ 05 ] : /docs/custom-actions#creating-a-media-script
85
- [ 06 ] : /releases/v5.9 .0/media-upload.png
142
+ [ 06 ] : /releases/v10.0 .0/media-upload.png
0 commit comments