# block

> Shoplazza Theme 中的 block Liquid 对象：承载 section block 的内容和 settings，在模板渲染时使用。

[section block](/docs/theme/architecture/sections/section-schema#blocks) 的内容和 settings。

Sections 和 blocks 是构成 [templates](/docs/theme/architecture/templates/overview) 的可复用内容模块。

  
    
      
        Properties
      

      
        Type
      

      
        Description
      
    
  

  
    
      
        `id`
      

      
        [number](../basics/liquid-types#number)
      

      
        block 的 ID，由 Shoplazza 动态生成。
      
    

    
      
        `settings`
      

      
        *
      

      
        block 的 [settings](/docs/theme/architecture/sections/section-schema#blocks)。

        要了解如何访问 settings，请参阅[访问 settings](/docs/theme/architecture/settings/overview#访问设置)。要了解哪些 input settings 可以应用于 settings 中的 type 属性，请参阅 [Input settings](/docs/theme/architecture/settings/input-settings)。
      
    

    
      
        `shoplaza_attributes`
      

      
        [string](../basics/liquid-types#string)
      

      
        block 的数据属性，用于 theme editor。

        theme editor 的 JavaScript API 使用数据属性来识别 blocks 并监听事件。在 theme editor 之外，`block.shoplaza_attributes` 不返回值。
      
    

    
      
        `type`
      

      
        [string](../basics/liquid-types#string)
      

      
        block 的类型。

        类型是在 [block 的 schema](/docs/theme/architecture/sections/section-schema#blocks) 中定义的自由格式字符串，可用作标识符。例如，您可以根据 block 类型显示不同的标记。
      
    
  

```json title="对象"
{
  "id": "0",
  "type": "announcement",
  "settings": {},
  "shoplaza_attributes": "data-shoplaza-editor-block=\"{\"index\":0,\"type\":\"announcement\"}"
}
```
