Skip to main content

媒体库简介

¥Introduction to the Media Library

媒体库是一个 Strapi 插件,默认情况下始终处于激活状态且无法停用。当应用处于开发和生产环境中时都可以访问它。

¥The Media Library is a Strapi plugin that is always activated by default and cannot be deactivated. It is accessible both when the application is in a development and production environment.

管理员可以从以下位置访问媒体库

¥Administrators can access the Media Library from

ML icon

管理面板主导航中的媒体库。

¥Media Library in the main navigation of the admin panel.

Media Library overview, annotatedMedia Library overview, annotated

媒体库显示在应用中上传的所有资源,无论是通过媒体库本身还是在管理媒体字段时通过内容管理器。上传到媒体库的资源可以使用 内容管理者 插入到内容类型中。

¥The Media Library displays all assets uploaded in the application, either via the Media Library itself or via the Content Manager when managing a media field. Assets uploaded to the Media Library can be inserted into content-types using the Content Manager.

从媒体库中,可以:

¥From the Media Library, it is possible to:

  • 上传新资源(参见 添加资源)或创建新文件夹(参见 使用文件夹组织资源1,

    ¥upload a new asset (see adding assets) or create a new folder (see organizing assets with folders) 1,

  • 对资源和文件夹进行排序或设置过滤器 2 以更轻松地查找资源和文件夹,

    ¥sort the assets and folders or set filters 2 to find assets and folders more easily,

  • 在列表视图之间切换

    ¥toggle between the list view

List icon

和网格视图

¥and the grid view

Grid icon

显示资源、访问设置

¥to display assets, access settings

Settings icon

配置视图,并进行文本搜索

¥to configure the view, and make a textual search

Search icon

3 查找特定资源或文件夹,

¥3 to find a specific asset or folder,

  • 并查看、浏览和管理文件夹 4

    ¥and view, navigate through, and manage folders 4.

💡 提示

单击搜索图标

¥Click the search icon

Search icon

在用户界面的右侧,使用文本搜索并更快地找到你的资源或文件夹之一!

¥on the right side of the user interface to use a text search and find one of your assets or folders more quickly!

过滤资源

¥Filtering assets

在界面左侧的文件夹和资源列表正上方,a

¥Right above the list of folders and assets, on the left side of the interface, a

Filter icon

显示过滤器按钮。它允许设置一个或多个基于条件的过滤器,这些过滤器相互叠加(即,如果你设置多个条件,则仅显示与所有条件匹配的资源)。

¥Filters button is displayed. It allows setting one or more condition-based filters, which add to one another (i.e. if you set several conditions, only the assets that match all the conditions will be displayed).

FiltersFilters

要设置新过滤器:

¥To set a new filter:

  1. 单击

    ¥Click on the

Filter icon

过滤器按钮。2.3.4.对于基于日期和时间的条件(即 createdAt 或 updatedAt 字段),单击左侧字段以选择日期,然后单击右侧字段以选择时间。5.

¥Filters button. 2. Click on the 1st drop-down list to choose the field on which the condition will be applied. 3. Click on the 2nd drop-down list to choose the type of condition to apply. 4. For conditions based on the type of asset to filter, click on the 3rd drop-down list and choose a file type to include or exclude. For conditions based on date and time (i.e. createdAt or updatedAt fields), click on the left field to select a date and click on the right field to select a time. 5. Click on the Add filter button.

✏️ 注意

当处于活动状态时,过滤器显示在旁边

¥When active, filters are displayed next to the

Filter icon

过滤器按钮。可以通过单击删除图标将其删除

¥Filters button. They can be removed by clicking on the delete icon

Clear icon

.

对资源进行排序

¥Sorting assets

SortSort

就在文件夹和资源列表上方和旁边

¥Just above the list of folders and assets and next to the

Filter icon

界面左侧的“过滤器”按钮,显示一个下拉按钮。它允许按上传日期、字母顺序或更新日期对资源进行排序。单击下拉按钮并从列表中选择一个选项以自动显示已排序的资源。

¥Filters button, on the left side of the interface, a drop-down button is displayed. It allows to sort the assets by upload date, alphabetical order or date of update. Click on the drop-down button and select an option in the list to automatically display the sorted assets.

配置视图

¥Configuring the view

就在文件夹和资源列表的上方,在界面的右侧,有一组 3 个按钮。点击

¥Just above the list of folders and assets, on the right side of the interface, there is a group of 3 buttons. Click on

Settings icon

配置媒体库的默认视图。

¥to configure the default view for the Media library.

Configure the viewConfigure the view

从那里你可以:

¥From there you can:

  • 使用每页条目下拉列表定义默认显示的资源数量

    ¥Use the Entries per page dropdown to define the number of assets displayed by default

  • 使用默认排序顺序下拉列表定义资源显示的默认顺序。当你在媒体库中进行 对资源进行排序 时,可以覆盖此设置。

    ¥Use the Default sort order dropdown the define the default order in which assets are displayed. This can be overriden when you sort assets in the Media Library.

这两个设置均用作媒体库和 内容管理器媒体上传模式 中的默认设置。此处保存的设置对于所有用户来说是整个 Strapi 项目的全局设置。

¥Both settings are used as the defaults in the Media Library and in the Content Manager media upload modal. The settings saved here are global across the entire Strapi project for all users.