Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions docs/config/handbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ export default [
'title.fr-FR': 'Template de blocs',
'title.zh-CN': '区块模板',
'title.ja-JP': 'ブロックテンプレート',
link: '/handbook/ui/blocks/block-templates',
link: '/handbook/block-template',
},
{
title: 'Block settings',
Expand Down Expand Up @@ -941,12 +941,19 @@ export default [
'title.ja-JP': 'データブロックを接続',
link: '/handbook/ui/blocks/block-settings/connect-block',
},
{
title: 'Revert to template',
'title.fr-FR': 'Restaurer le modèle',
'title.zh-CN': '恢复到模板',
'title.ja-JP': 'テンプレートに戻す',
link: '/handbook/block-template',
},
{
title: 'Save as template',
'title.fr-FR': 'Enregistrer une template',
'title.zh-CN': '保存为区块模板',
'title.fr-FR': 'Enregistrer comme modèle',
'title.zh-CN': '保存为模板',
'title.ja-JP': 'テンプレートとして保存',
link: '/handbook/ui/blocks/block-settings/block-template',
link: '/handbook/block-template',
},
{
title: 'Linkage rules',
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/block-gantt/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ It's a built-in plugin, no installation is required.

For more details, refer to [Setting Data Range](/handbook/ui/blocks/block-settings/data-scope).

- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)
- [Set Data Loading Mode](/handbook/ui/blocks/block-settings/loading-mode)

## Action Configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/block-map/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ For more information, see [Block Height](/handbook/ui/blocks/block-settings/bloc

- [Edit Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Connect Data Block](/handbook/ui/blocks/block-settings/connect-block)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

## Configuration Operations

Expand Down
90 changes: 90 additions & 0 deletions docs/en-US/handbook/block-template/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# 区块模板

<PluginInfo name="block-template"></PluginInfo>

## 介绍

区块模板用于为区块提供模板能力, 可用于模板的集中管理及通过模板创建区块。通过模板创建的区块, 与模板是继承关系, 可以在模板基础上增加自己的配置。

## 安装

内置插件, 无需安装。

## 使用说明

![主界面](https://static-docs.nocobase.com/main-screen-block-template.png)

### 模板管理

#### 创建模板

点击 "新增" 按钮, 输入相关信息, 点击 "提交" 按钮, 即可创建模板。

![创建模板](https://static-docs.nocobase.com/create-template.png)

##### 保存为模板

页面中的数据区块, 可以通过 "保存为模板" 菜单, 将当前区块保存为模板。

![保存为模板](https://static-docs.nocobase.com/save-as-block-template.png)

:::info{title=注意}
- 仅支持页面中的数据区块保存为模板。不支持将弹窗中区块直接保存为模板。
:::

#### 配置模板

选择模板, 点击 "配置" 按钮, 即可进入模板配置界面, 配置模板数据区块。

![配置模板](https://static-docs.nocobase.com/configure-template.png)

:::info{title=注意}
- 目前模板仅支持添加一个数据区块, 未配置数据区块时, 将无法使用该模板创建区块。
- 图表区块暂不支持配置为模板。
:::

#### 编辑模板

选择模板, 点击 "编辑" 按钮, 即可进入模板编辑界面修改模板标题、描述。

![编辑模板](https://static-docs.nocobase.com/edit-template.png)

#### 复制模板

选择模板, 点击 "复制" 按钮, 输入新模板标题, 点击 "提交" 按钮, 即可复制模板。
模板复制后可以进行编辑以适应新的需求场景。

![复制模板](https://static-docs.nocobase.com/copy-template.png)

#### 删除模板

选择模板, 点击 "删除" 按钮, 点击 "提交" 按钮, 即可删除模板。

![删除模板](https://static-docs.nocobase.com/delete-template.png)

删除可以选择是否"保留已创建的区块":
- 若选择保留, 则模板被删除后, 已创建的区块会被转换成普通的页面区块。
- 若选择不保留, 则模板被删除后, 已创建的区块也会被删除。

### 模板使用

#### 创建区块

在页面中创建区块时, 选择对应区块的模板, 即可使用模板创建区块。

![创建区块](https://static-docs.nocobase.com/create-block.png)

从模板创建的区块与普通区块有以下几点不同:
1. 该区块与模板是继承关系, 可以在模板基础上增加自己的配置, 未修改的配置会与模板保持同步。
2. 继承自模板的 UI 组件无法从页面中删除。
![无法删除](https://static-docs.nocobase.com/disable-delete.png)

3. 区块新增的字段、操作会以不同的背景色展示, 以便区分。
![区块样式](https://static-docs.nocobase.com/template-bg.png)

4. 区块及继承自模板的 UI 组件均会多一个 "恢复到模板" 的配置项, 用于恢复到模板完全一致的状态。
![恢复到模板](https://static-docs.nocobase.com/revert-to-template.gif)

:::info{title=注意}
区块内部的 UI 组件的位置以页面为准, 创建后不能自动同步模板中的位置, 若需要同步模板中的位置, 只能将整个区块恢复到模板。
:::
2 changes: 1 addition & 1 deletion docs/en-US/handbook/block-tree/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ For more information, refer to [Connecting Data Block](/handbook/ui/blocks/block

- [Editing Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Linkage Rule](/handbook/ui/blocks/block-settings/linkage-rule)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

## Configuring Fields

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/calendar/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Clicking on a task bar highlights the selection and opens a detailed pop-up wind
![20240419203603](https://static-docs.nocobase.com/20240419203603.png)

- [Edit Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

### Set Data Range

Expand Down
27 changes: 13 additions & 14 deletions docs/en-US/handbook/ui/blocks/block-settings/block-template.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# Save as template
<PluginInfo name="ui-schema-storage"></PluginInfo>
# 保存为区块模板
<PluginInfo name="block-template"></PluginInfo>

## Introduction
## 介绍

Saving a block as a template allows you to save both the block and its associated data tables. These templates can be centrally managed on the template management page. When adding a block, you can choose to reference or copy a template to quickly create a new block.
保存为区块模板是将区块及其关联的数据表保存为模板,在模板管理页中可以统一管理这些模板,在添加区块时,可以选择该模板快速创建区块。

## User Guide
## 使用手册
![20240407175846](https://static-docs.nocobase.com/save-as-block-template.png)

![20240407175846](https://static-docs.nocobase.com/20240407175846.png)
自定义区块模板名称。

You can customize the name of the block template.
![save-as-template-dialog](https://static-docs.nocobase.com/save-as-template-dialog.png)

![20240407153407](https://static-docs.nocobase.com/20240407153407.png)
在区块模板管理页中统一管理所有区块模板。

All block templates can be centrally managed on the block template management page.
![20240407153550](https://static-docs.nocobase.com/main-screen-block-template.png)

![20240407153550](https://static-docs.nocobase.com/20240407153550.png)
在添加区块时候选择模板,快速创建区块。

When adding a block, you can either reference or copy a template to create the block quickly.
![20240422095346](https://static-docs.nocobase.com/create-block.png)

![20240422095346](https://static-docs.nocobase.com/20240422095346.png)

For more information about block templates, refer to [Block Templates](/handbook/ui/blocks/block-templates).
更多区块模板介绍可参考 [区块模板](/handbook/block-template)
26 changes: 0 additions & 26 deletions docs/en-US/handbook/ui/blocks/block-templates.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/en-US/handbook/ui/blocks/data-blocks/details.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ For more details, please refer to [Setting Data Scope](/handbook/ui/blocks/block
For more details, please refer to [Sorting Rules](/handbook/ui/blocks/block-settings/sorting-rule)

- [Set Data Loading Method](/handbook/ui/blocks/block-settings/loading-mode)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

## Configure Fields

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/ui/blocks/data-blocks/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Solution: Select an existing product as a template and use its attribute informa
</video>

- [Edit Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

## Configure Fields

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/ui/blocks/data-blocks/grid-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Example: Configure the Orders Grid Card block to display in "Full Height" mode f
For more details, refer to [Block Height](/handbook/ui/blocks/block-settings/block-height).

- [Setting Sorting Rules](/handbook/ui/blocks/block-settings/sorting-rule)
- [Saving as a Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Saving as a Block Template](/handbook/block-template)

## Configuring Fields

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/ui/blocks/data-blocks/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Example: Set the height of the order list block to "Full Height" mode.
For more details, refer to [Block Height](/handbook/ui/blocks/block-settings/block-height).

- [Edit Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

## Configuring Fields

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/ui/blocks/data-blocks/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ For more information, refer to [Connecting Data Blocks](/handbook/ui/blocks/bloc

- [Edit Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Set Data Loading Mode](/handbook/ui/blocks/block-settings/loading-mode)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

## Configure Fields

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/ui/blocks/filter-blocks/collapse.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Example: Connect the same data table block in the pop-up window to achieve filte
For more content, refer to [Connecting Data Blocks](/handbook/ui/blocks/block-settings/connect-block)

- [Edit Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

## Configuring Fields

Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/ui/blocks/filter-blocks/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For more content, refer to [Connect to Data Block](/handbook/ui/blocks/block-set

- [Edit Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Linkage Rules](/handbook/ui/blocks/block-settings/linkage-rule)
- [Save as Block Template](/handbook/ui/blocks/block-settings/block-template)
- [Save as Block Template](/handbook/block-template)

## Field Configuration

Expand Down
4 changes: 2 additions & 2 deletions docs/en-US/manual/core-concepts/blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ NocoBase 目前内置 10 几种区块,未来可以通过插件的方式支持

1. 选择区块类型:目前可用的区块类型包括表格、表单、详情、日历、看板、Markdown
2. 选择 Collection:此处会列出所有的 Collection
3. 选择创建方式:创建空白区块,或者从复制区块模板,或者引用区块模板
3. 选择创建方式:创建空白区块,或者从模板创建
4. 选择模板:若第 3 步选择了从模板创建,则在第 4 步选择模板

![6.block-add.jpg](https://static-docs.nocobase.com/4a4dad014fddada53f2d49f5dba681fb.jpg)
Expand Down Expand Up @@ -80,7 +80,7 @@ NocoBase 目前内置 10 几种区块,未来可以通过插件的方式支持

## 区块模板

你可以将一个区块保存为模板,以后可以复制或引用这个模板
你可以将一个区块保存为模板,以后可以通过这个模板快速创建新的区块

比如,一个数据表的表单,既用于新增数据,又用于编辑数据,那就可以将这个表单保存为模板,在新增数据和编辑数据的界面里引用它。

Expand Down
14 changes: 2 additions & 12 deletions docs/en-US/manual/ui/blocks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,11 @@

## 区块模板

可以将一个数据类型区块保存为模板,以后添加区块时可以直接复制或引用这个模板。比如,一个数据表的表单,既用于新增数据,又用于编辑数据,那就可以将这个表单保存为模板,在新增数据和编辑数据的界面里引用它
可以将一个数据类型区块保存为模板,以后添加区块时可以直接使用这个模板。比如,一个数据表的表单,既用于新增数据,又用于编辑数据,那就可以将这个表单保存为模板,在新增数据和编辑数据的界面里通过该模板创建对应的表单区块

### 如何添加和使用模板?

1. 将数据区块保存为区块模板(只有数据类型的区块才有这个配置项)

![](https://static-docs.nocobase.com/b7718cea8784587d53524ade3c5b0a82.png)

1. 添加区块时,选择复制或引用模板

![](https://static-docs.nocobase.com/135df7344e0f3080199e4bb1071c2fa6.png)

### 复制和引用的区别

复制是基于区块模板创建的全新区块,区块有调整不影响模块;引用是直接使用区块模板,区块调整会改变模板,所有引用了当前模板的区块都会产生变化。
参考[区块模板](/handbook/block-template)

## 区块类型

Expand Down
2 changes: 1 addition & 1 deletion docs/fr-FR/handbook/block-gantt/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Il s'agit d'un plugin intégré, aucune installation n'est requise.

Pour plus de détails, consultez [Définir la plage de données](/handbook/ui/blocks/block-settings/data-scope).

- [Enregistrer en tant que modèle de bloc](/handbook/ui/blocks/block-settings/block-template)
- [Enregistrer en tant que modèle de bloc](/handbook/block-template)
- [Définir le mode de chargement des données](/handbook/ui/blocks/block-settings/loading-mode)

## Configuration des actions
Expand Down
2 changes: 1 addition & 1 deletion docs/fr-FR/handbook/block-map/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Pour plus d'informations, consultez [Hauteur du Bloc](/handbook/ui/blocks/block-

- [Modifier le Titre du Bloc](/handbook/ui/blocks/block-settings/block-title)
- [Connecter un Bloc de Données](/handbook/ui/blocks/block-settings/connect-block)
- [Enregistrer comme Modèle de Bloc](/handbook/ui/blocks/block-settings/block-template)
- [Enregistrer comme Modèle de Bloc](/handbook/block-template)

## Opérations de Configuration

Expand Down
Loading