---
title: "settings"

doc_type: static
doc_category: static
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/zh-hans-cn/docs/sline/object/settings'
  md: 'https://developer.shopline.com/zh-hans-cn/docs/sline/object/settings.md'
---

# settings


    主题的全局设置。其包含的配置项由主题的 [theme.config.json](https://developer.shopline.com/zh-hans-cn/docs/online-store-3-0-themes/theme-structure/theme-config-json.md) 文件定义。

    





    
## 例子

        
            

            以下示例根据全局配置中 `cart_add_type` 的不同值，在客户加购后动态执行不同的购物车打开方式。这使得同一套主题代码能够适配不同的交互需求。

            

            
<SlineExample path={''} objects={ 
    [""] 
}>
```sline
{{#if settings.cart_add_type == "drawer"}}
Open the drawer cart.
{{#else/}}
Jump to cart page.
{{/if}}
```
</SlineExample>
            
        
    
