Skip to main content

内容管理者

¥Content Manager

内容管理器(可通过管理面板的主导航访问),用户可以编写和管理他们的内容。

¥From the Content Manager, accessible via the main navigation of the admin panel, users can write and manage their content.

内容管理器的身份证

角色和权限:角色 > 插件中的最低 "配置视图" 权限 - 内容管理器。
环境:在开发和生产环境中均可用。

¥ Role & permission: Minimum "Configure view" permissions in Roles > Plugins - Content Manager.
Environment: Available in both Development & Production environment.

概述

¥Overview

内容管理器包含使用 内容类型生成器 预先创建的可用集合和单一内容类型。

¥The Content Manager contains the available collection and single content-types which were created beforehand using the Content-type Builder.

可以从 内容管理器子导航中显示的 2 个类别中创建、管理和发布内容:

¥Content can be created, managed and published from the 2 categories displayed in the sub navigation of the Content Manager:

  • 集合类型,列出了管理多个条目的可用内容类型。对于每个可用的集合类型,可以创建多个条目,这就是为什么每个集合类型分为 2 个接口:

    ¥Collection types, which lists available content-types managing several entries. For each available collection type, multiple entries can be created, which is why each collection type is divided into 2 interfaces:

    • 列表视图,显示一个表格,其中包含为该集合类型创建的所有条目。

      ¥the list view, which displays a table with all entries created for that collection type.

    • 编辑视图,重点关注你集合类型的所选条目,你可以从中实际管理内容。

      ¥the edit view, which focuses on a chosen entry of your collection type, and from where you can actually manage the content.

  • 单一类型,仅使用一个条目列出可用的内容类型。与具有多个条目的集合类型不同,不会为多种用途创建单一类型。换句话说,每种可用的单一类型只能有一个默认条目。因此,单一类型类别中没有列表视图。

    ¥Single types, which lists available content-types with only one entry. Unlike collection types, which have multiple entries, single types are not created for multiple uses. In other words, there can only be one default entry per available single type. There is therefore no list view in the Single types category.

提示

单击搜索图标 以使用文本搜索并更快地找到你的内容类型和/或条目之一!

¥Click the search icons to use a text search and find one of your content-types and/or entries more quickly!

具体来说,对于集合类型的条目,你还可以使用 过滤器按钮设置基于条件的过滤器,这些过滤器会相互添加(即,如果你设置了多个条件,则只会显示符合所有条件的条目)。

¥Specifically for your collection types' entries, you can also use the Filters button to set condition-based filters, which add to one another (i.e., if you set several conditions, only the entries that match all the conditions will be displayed).

配置

¥Configuration

列表视图和编辑视图都可以配置,前者可以临时或永久配置。

¥Both the list view and the edit view can be configured, and the former can either be configured temporarily or permanently.

配置列表视图

¥Configuring the list view


临时配置

¥Temporary configuration

通过临时配置列表视图,配置将在页面刷新或在内容管理器外导航时立即重置。此配置允许临时选择要在列表视图的表中显示的字段。

¥By configuring temporarily the list view, the configurations will be reset as soon as the page is refreshed or when navigating outside the Content Manager. This configuration allows to temporarily choose which fields to display in the list view's table.

  1. 点击设置按钮

    ¥Click on the settings button .

  2. 勾选与要在表中显示的字段关联的框。

    ¥Tick the boxes associated with the field you want to be displayed in the table.

  3. 取消勾选与你不想在表中显示的字段相关的框。

    ¥Untick the boxes associated with the fields you do not want to be displayed in the table.

Displayed fields in the settings of a list view in the Content ManagerDisplayed fields in the settings of a list view in the Content Manager

永久和高级配置

¥Permanent & advanced configuration

通过永久配置列表视图,你不仅可以确保它们不会在每次页面刷新或导航时重置,而且还可以访问更多选项(例如,启用/禁用搜索、过滤器和批量操作、重新排序列表视图表的字段等)。

¥By configuring permanently the list view, you not only ensure that they are not reset at every page refresh or navigation, but you also have access to more options (e.g., enablement/disablement of search, filters and bulk actions, reordering of the list view table's fields etc.).

注意

配置仅适用于访问设置的集合类型的列表视图(即,禁用集合类型的过滤器或搜索选项不会自动禁用所有其他集合类型的这些相同选项)。

¥The configurations only apply to the list view of the collection type from which the settings are accessed (i.e., disabling the filters or search options for a collection type will not automatically also disable these same options for all other collection types).

Settings of a list view in the Content ManagerSettings of a list view in the Content Manager
  1. 在你的集合类型的列表视图中,单击设置按钮 ,然后单击 配置要重定向到列表视图配置界面的视图。

    ¥In the list view of your collection type, click on the settings button then Configure the view to be redirected to the list view configuration interface.

  2. 在“设置”区域中,定义你选择的新设置:

    ¥In the Settings area, define your chosen new settings:

设置名称指示
启用搜索单击 TRUE 或 FALSE 可启用或禁用搜索。
启用过滤器单击 TRUE 或 FALSE 可启用或禁用过滤器。
启用批量操作单击 TRUE 或 FALSE 可启用或禁用列表视图表格中的多个选择框。
每页条目数从下拉列表中选择每页的条目数。
默认排序属性选择默认使用的排序字段。
默认排序顺序选择默认情况下应用的排序类型。
  1. 单击“保存”按钮。

    ¥Click on the Save button.

配置编辑视图

¥Configuring the edit view

Configuring the edit view of the Content ManagerConfiguring the edit view of the Content Manager
  1. 在你的内容类型的编辑视图中,单击 按钮,然后单击 配置视图。

    ¥In the edit view of your content-type, click on the button then Configure the view.

  2. 在“设置”区域中,定义你选择的新设置:

    ¥In the Settings area, define your chosen new settings:

设置名称指示
入口标题从下拉列表中选择应用作条目标题的字段。
  1. 单击“保存”按钮。

    ¥Click on the Save button.

用法

¥Usage


创建和编写内容

¥Creating & Writing content

在 Strapi 中,编写内容包括填写字段,这些字段旨在包含特定内容(例如文本、数字、媒体等)。这些字段预先通过 内容类型生成器.config 配置为集合或单一类型。

¥In Strapi, writing content consists in filling up fields, which are meant to contain specific content (e.g. text, numbers, media, etc.). These fields were configured for the collection or single type beforehand, through the Content-type Builder.

Edit view to write contentEdit view to write content

编写或编辑内容:

¥To write or edit content:

  1. 内容管理器中:

    ¥In the Content Manager:

    • 单击所选集合类型右上角的“创建新条目”按钮以创建新条目,

      ¥Either click on the Create new entry button in the top right corner of the collection type of your choice to create a new entry,

    • 或者访问你已创建的集合类型的条目或单一类型的编辑视图。

      ¥Or access the edit view of your already created collection type's entry or single type.

  2. 按照可用的字段架构编写你的内容。你可以参考下表,了解有关如何填写每种字段类型的更多信息和说明。

    ¥Write your content, following the available field schema. You can refer to the table below for more information and instructions on how to fill up each field type.

注意

仅当新条目的某些内容被写入并保存一次后,才被视为已创建。只有这样,新条目才会在列表视图中列出。

¥New entries are only considered created once some of their content has been written and saved once. Only then will the new entry be listed in the list view.

Field nameInstructions
TextWrite your content in the textbox.
Rich text (Markdown)Write your textual content in the editor, in Markdown. Some basic formatting options (titles, bold, italics, underline) are available in the top bar of the editor to apply to selected text. A Preview mode/Markdown mode button to switch between modes is also available.

💡 The box can be expanded by clicking on Expand in the bottom bar. It displays side by side, at the same time, the textbox that you can edit and the preview.
Rich text (Blocks)Write and manage your content in the editor, which automatically renders live all additions/updates. In the Blocks editor, paragraphs behave as blocks of text: hovering on a paragraph will display an icon on which to click to reorder the content. Options to format or enrich the content are also accessible from the top bar of the editor (basic formatting options, code, links, image etc.).

💡 You can use text formatting keyboard shortcuts in the Blocks editor (e.g. bold, italics, underline, and pasting link).
NumberWrite your number in the textbox. Up and down arrows, displayed on the right of the box, allow to increase or decrease the current number indicated in the textbox.
Date1. Click the date and/or time box.
2. Type the date and time or choose a date using the calendar and/or a time from the list. The calendar view fully supports keyboard-based navigation.
Media1. Click the media area.
2. Choose an asset from the Media Library or from a folder if you created some, or click the Add more assets button to add a new file to the Media Library.

💡 It is possible to drag and drop the chosen file in the media area.
RelationChoose an entry from the drop-down list. See relational fields for more information.
BooleanClick on TRUE or FALSE.
JSONWrite your content, in JSON format, in the code textbox.
EmailWrite a complete and valid email address.
PasswordWrite a password.

💡 Click the icon, displayed on the right of the box, to show the password.
Enumeration1. Click the drop-down list.
2. Choose an entry from the list.
UIDWrite a unique identifier in the textbox. A "Regenerate" button, displayed on the right of the box, allows automatically generating a UID based on the content type name.
注意

填写 自定义字段 取决于字段处理的内容类型。请参阅 市场  上托管的每个自定义字段的专用文档。

¥Filling out a custom field depends on the type of content handled by the field. Please refer to the dedicated documentation for each custom field hosted on the Marketplace .

组件

¥Components

组件是多个字段的组合,这些字段在编辑视图中分组在一起。编写其内容的方式与独立字段完全相同,但组件有一些特殊性。

¥Components are a combination of several fields, which are grouped together in the edit view. Writing their content works exactly like for independent fields, but there are some specificities to components.

有 2 种类型的组件:不可重复和可重复的组件。

¥There are 2 types of components: non-repeatable and repeatable components.

Non-repeatable component - No entry yetNon-repeatable component - No entry yetNon-repeatable component - With entriesNon-repeatable component - With entries

不可重复组件是只能使用一次的字段组合。

¥Non-repeatable components are a combination of fields that can be used only once.

默认情况下,字段组合不会直接显示在编辑视图中:

¥By default, the combination of fields is not directly displayed in the edit view:

  1. 单击添加按钮 以添加组件。

    ¥Click on the add button to add the component.

  2. 填写组件的字段。

    ¥Fill in the fields of the component.

要删除不可重复的组件,请单击位于组件区域右上角的删除按钮

¥To delete the non-repeatable component, click on the delete button , located in the top right corner of the component area.

动态区域

¥Dynamic zones

动态区域是组件的组合,组件本身又由多个字段组成。写入动态区域的内容需要额外的步骤才能访问这些字段。

¥Dynamic zones are a combination of components, which themselves are composed of several fields. Writing the content of a dynamic zone requires additional steps in order to access the fields.

Writing content for a dynamic zoneWriting content for a dynamic zone Writing content for a dynamic zoneWriting content for a dynamic zone
  1. 单击 将组件添加到 [动态区域名称] 按钮。

    ¥Click on the Add a component to [dynamic zone name] button.

  2. 选择动态区域可用的组件。

    ¥Choose a component available for the dynamic zone.

  3. 填写组件的字段。

    ¥Fill in the fields of the component.

动态区域的组件还可以使用组件区域右上角显示的按钮直接在编辑视图中重新排序或删除。

¥Dynamic zones' components can also be reordered or deleted directly in the edit view, using buttons displayed in the top right corner of the component area.

  • 使用拖放按钮 重新排序动态区域中的组件。

    ¥Use the drag & drop button to reorder components in your dynamic zone.

  • 使用删除按钮从动态区域中删除组件。

    ¥Use the delete button to delete a component from your dynamic zone.

提示

你还可以使用键盘对组件重新排序:使用 Tab 聚焦组件,在拖放按钮 上按空格键,然后使用箭头键重新排序,再次按空格键放下该项目。

¥You can also use the keyboard to reorder components: focus the component using Tab, press Space on the drag & drop button and use the arrow keys to then re-order, pressing Space again to drop the item.

注意

与常规字段不同,动态字段内的字段和组件的顺序很重要。它应该与终端用户阅读/查看内容的方式完全一致。

¥Unlike regular fields, the order of the fields and components inside a dynamic field is important. It should correspond exactly to how end users will read/see the content.

关系字段

¥Relational fields

添加到内容类型的关系类型字段允许与另一个集合类型建立关系。这些字段称为 "关系字段"。

¥Relation-type fields added to a content-type allow establishing a relation with another collection type. These fields are called "relational fields".

关系字段的内容是从它们所属的内容类型的编辑视图写入的。但是,关系字段可以指向其他集合类型的一个或多个条目,这就是为什么在内容管理器中可以管理内容类型的关系字段以选择哪些条目相关。

¥The content of relational fields is written from the edit view of the content-type they belong to. However, relational fields can point to one or several entries of the other collection type, this is why in the Content Manager it is possible to manage a content-type's relational fields to choose which entries are relevant.

Example of relational fields

在我的 Strapi 管理面板中,我创建了 2 种集合类型:

¥In my Strapi admin panel I have created 2 collection types:

  • 餐厅,每个入口都是一家餐厅

    ¥Restaurant, where each entry is a restaurant

  • 类别,其中每个条目都是一种餐厅类型

    ¥Category, where each entry is a type of restaurant

我想为我的每家餐厅分配一个类别,因此我在两种集合类型之间建立了关系:餐馆可以有一个类别。

¥I want to assign a category to each of my restaurants, therefore I have established a relation between my 2 collection types: restaurants can have one category.

在内容管理器中,从我的餐厅条目的编辑视图中,我可以管理类别关系字段,并选择与我的餐厅相关的类别条目。

¥In the Content Manager, from the edit view of my Restaurant entries, I can manage the Category relational field, and choose which entry of Category is relevant for my restaurant.

Relational fields in the edit viewRelational fields in the edit view

多对一、一对一和单向关系类型仅允许为每个关系字段选择一个条目。

¥Many-to-one, one-to-one, and one-way types of relation only allow to choose one entry per relational field.

One-choice relational fieldsOne-choice relational fields

要选择唯一相关的关系字段条目:

¥To select the only relevant relational field's entry:

  1. 在内容类型的编辑视图中,单击关系字段的下拉列表。

    ¥In the content-type's edit view, click on the drop-down list of the relational field.

  2. 在条目列表中,选择一项。

    ¥Among the list of entries, choose one.

要删除下拉列表中选择的条目,请单击删除按钮

¥To remove the entry selected in the drop-down list, click on the delete button .

提示
  • 默认情况下并未列出所有条目:单击“加载更多”按钮可以显示更多内容。此外,你可以单击任何关系字段下拉列表并键入来搜索特定条目,而不是通过滚动列表来选择条目。

    ¥Not all entries are listed by default: more can be displayed by clicking on the Load more button. Also, instead of choosing an entry by scrolling the list, you can click any relational field drop-down list and type to search a specific entry.

  • 单击条目名称以显示模式,你可以从中编辑关系字段的内容类型。目前,你只能即时编辑关系,而不能创建新关系。

    ¥Click on the name of an entry to display a modal from where you will be able to edit the relational field's content-type. For now, you can only edit a relation on-the-fly and not create a new one.

注意
  • 如果为关系字段所属的内容类型激活了 草稿和发布功能,你会注意到下拉列表中条目名称旁边的蓝点或绿点。它们指示条目的状态,分别是草稿或已发布的内容。

    ¥If the Draft & Publish feature is activated for the content-type the relational field belongs to, you will notice blue or green dots next to the entries names in the drop-down list. They indicate the status of the entry, respectively draft or published content.

  • 如果为内容类型启用了 国际化 (i18n) 功能,则条目列表可能会受到限制或因语言环境而异。仅列出可能为关系字段选择的相关条目。

    ¥If the Internationalization (i18n) feature is enabled for the content-type, the list of entries may be limited or differ from one locale to another. Only relevant entries that can possibly be chosen for a relational field will be listed.

删除内容

¥Deleting content

你可以通过删除集合类型的任意条目或单一类型的默认条目来删除内容。

¥You can delete content by deleting any entry of a collection type, or the default entry of a single type.

  1. 在条目的编辑视图中,点击界面右上角的,然后点击删除文档按钮。
    如果内容类型启用了国际化,你还可以选择仅删除当前选定的语言环境,方法是点击删除语言环境按钮。

    ¥In the edit view of the entry, click on at the top right of the interface, and click the Delete document button.
    If Internationalization is enabled for the content-type, you can also choose to delete only the currently selected locale by clicking on the Delete locale button.

  2. 在弹出的窗口中,单击确认按钮确认删除。

    ¥In the window that pops up, click on the Confirm button to confirm the deletion.

Deleting entriesDeleting entries
提示

你可以通过单击表中条目记录右侧的 ,然后选择 删除文档按钮,从集合类型的列表视图中删除条目。
如果内容类型启用了 国际化,则删除文档会删除所有语言环境,而删除语言环境只会删除当前列出的语言环境。

¥You can delete entries from the list view of a collection type, by clicking on on the right side of the entry's record in the table, then choosing the Delete document button.
If Internationalization is enabled for the content-type, Delete document deletes all locales while Delete locale only deletes the currently listed locale.