Skip to main content

保存、发布和删除内容

¥Saving, publishing and deleting content

Strapi 允许你在内容的整个生命周期中管理内容,无论你是正在处理其草稿版本、即将完成它并与世界分享,还是想要在其过时时将其删除。

¥Strapi allows you to manage your content throughout its whole lifecycle, whether you are working on its draft version, about to finish it and share it with the world, or wanting to delete it when it's obsolete.

保存和发布内容

¥Saving & publishing content

提醒

管理内容草稿的可能性来自草稿和发布功能。默认情况下,此功能处于激活状态,但可以从内容类型生成器中针对任何内容类型禁用此功能。如果你禁用了“草稿和发布”功能,则保存内容意味着同时保存和发布。

¥The possibility to manage drafts for contents comes from the Draft & Publish feature. This feature is activated by default, but it can be deactivated for any content-type from the Content-type Builder. If you disabled the Draft & Publish feature, saving your content means saving and publishing at the same time.

你的内容可以有 2 种状态:起草或发表。你可以在界面右侧的信息框上方看到指示的当前状态。

¥Your contents can have 2 statuses: draft or published. You can see the current status indicated on the right of the interface, above the Information box.

Editing draft versionEditing draft version

默认情况下,每个新创建的内容都是草稿。可以使用编辑视图右上角的“保存”按钮随意修改和保存草稿,直到准备好发布为止。

¥By default, each newly created content is a draft. Drafts can be modified and saved at will, using the Save button on the top right corner of the edit view, until they are ready to be published.

发布和取消发布

¥Publishing and unpublishing

发布草稿

¥Publishing a draft

要发布草稿,请单击内容编辑器右上角的“发布”按钮。

¥To publish a draft, click on the Publish button in the top right corner of the content editor.

提醒

在发布草稿之前,请确保它与其他未发布的内容没有关系,否则某些内容可能无法通过 API 访问。

¥Before publishing a draft, make sure it doesn't have relations with other non-published content, otherwise some of the content may not be available through the API.

当内容不再是草稿但已发布时,会在界面右侧的信息框上方显示。

¥When a content is not a draft anymore, but has been published, it is indicated on the right of the interface, above the Information box.

Editing published versionEditing published version
💡 提示

要安排发布,即在给定日期和时间将草稿转换为已发布条目,你可以遵循 本技术指南,这需要向 Strapi 应用添加自定义代码。

¥To schedule publication, i.e. convert a draft to a published entry at a given date and time, you can follow this technical guide which requires adding custom code to the Strapi application.

取消发布内容

¥Unpublishing content

已发布的内容可以取消发布,再次切换回草稿。

¥Published contents can be unpublished, switching back to being drafts again.

要取消发布内容,请单击内容编辑器右上角的“取消发布”按钮。

¥To unpublish content, click on the Unpublish button in the top right corner of the content editor.

批量发布和取消发布

¥Bulk publishing and unpublishing

从内容管理器的列表视图中选择多个条目将显示附加按钮,用于同时发布或取消发布多个条目。这就是所谓的 "批量发布/取消发布"。

¥Selecting multiple entries from the Content Manager's list view will display additional buttons to publish or unpublish several entries simultaneously. This is what is called "bulk publishing/unpublishing".

提醒

如果安装了 国际化插件,批量发布/取消发布操作仅适用于当前选择的区域设置。

¥If the Internationalization plugin is installed, the bulk publish/unpublish actions only apply to the currently selected locale.

Selecting entries for bulk publish/unpublish

批量发布草稿

¥Bulk publishing drafts

要同时发布多个条目:

¥To publish several entries at the same time:

  1. 从内容管理器的列表视图中,通过勾选条目记录左侧的框来选择要发布的条目。

    ¥From the list view of the Content Manager, select your entries to publish by ticking the box on the left side of the entries' record.

  2. 单击位于表标题上方的“发布”按钮。

    ¥Click on the Publish button located above the header of the table.

  3. 在“发布条目”对话框中,检查所选条目的列表及其状态:

    ¥In the Publish entries dialog, check the list of selected entries and their status:

    • Success icon

准备发布:该条目可以发布

¥Ready to publish: the entry can be published

Fail icon

"[字段名称] 为必填项"、"[字段名称]太短" 或 "[字段名称]太长":由于红色警告消息中指出的问题,该条目无法发布。

¥"[field name] is required", "[field name] is too short" or "[field name] is too long": the entry cannot be published because of the issue stated in the red warning message.

  1. (可选)如果你的某些条目有

    ¥(optional) If some of your entries have a

Edit icon

状态,单击

¥status, click the

Edit icon

编辑按钮来修复问题,直到所有条目都有

¥edit buttons to fix the issues until all entries have the

Success icon

准备发布状态。请注意,在修复各种条目问题时,你必须单击“刷新”按钮来更新“发布条目”对话框。5.6.

¥Ready to publish status. Note that you will have to click on the Refresh button to update the Publish entries dialog as you fix the various entries issues. 5. Click the Publish button. 6. In the confirmation dialog box, confirm your choice by clicking again on the Publish button.

批量取消发布内容

¥Bulk unpublishing content

要同时取消发布多个条目:

¥To unpublish several entries at the same time:

  1. 从内容管理器的列表视图中,通过勾选条目记录左侧的框来选择要取消发布的条目。

    ¥From the list view of the Content Manager, select your entries to unpublish by ticking the box on the left side of the entries' record.

  2. 单击位于表标题上方的“取消发布”按钮。

    ¥Click on the Unpublish button located above the header of the table.

  3. 在确认对话框中,再次单击“取消发布”按钮确认你的选择。

    ¥In the confirmation dialog box, confirm your choice by clicking again on the Unpublish button.

删除内容

¥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 the Delete this entry button, located at the bottom of the right side of the interface.

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

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

💡 提示

你可以通过单击删除按钮从集合类型的列表视图中删除条目

¥You can delete entries from the list view of a collection type, by clicking on the delete button

Delete icon

在表中条目记录的右侧。
你还可以同时删除多个条目。为此,请通过勾选条目记录左侧的框来选择要删除的条目。然后,单击表标题上方的“删除”按钮。

¥on the right side of the entry's record in the table.
You also have the possibility to delete multiple entries at the same time. To do so, select your entries to delete by ticking the box on the left side of the entries' record. Then, click on the Delete button located above the header of the table.

提醒

如果安装了 国际化插件,则一次只能删除一个区域设置的条目。

¥If the Internationalization plugin is installed, entries can only be deleted one locale at the time.