页面设计好 Html 代码

使用(其中diyid为自定义字段):

<style>
  .yd-demo{margin:30px 0;border-bottom:1px solid #cccccc;padding:60px}
  .yd-demo>h3{font-size:24px;text-align:center}
  .yd-demo>img{width:300px;}
</style>


<div class="yd-demo"><h3>图片</h3>
{{ section.settings.yd-img  | img_url: 'master' | img_tag}}
</div>
<div class="yd-demo"><h3>静态文本</h3>
{{ section.settings.yd-text }} 
</div>
<div class="yd-demo"><h3>富文本框内容</h3>
{{ section.settings.yd-richtext  }} 
</div>

<div class="yd-demo"><h3>多行文本</h3>
{{ section.settings.yd-textarea  }} 
</div>

<div class="yd-demo"><h3>URL链接</h3>
{{ section.settings.yd-url  }} 
</div>

<div class="yd-demo"><h3>radio应用</h3>
  <div style="width:300px;height:100px;background:{{ section.settings.yd-radio  }} "></div>
</div>

<div class="yd-demo"><h3>select应用</h3>
  <div style="width:300px;height:100px;background:{{ section.settings.yd-select  }} "></div>
</div>



{% schema %}
  {
    "name": "常用文本框",
    "settings": [
      {
        "type": "image_picker",
        "id": "yd-img",
        "label": "Image"
      },
      {
        "type": "text",
        "id": "yd-text",
        "label": "Heading",
        "default": "图片"
      },
      {
        "type": "richtext",
        "id": "yd-richtext",
        "label": "Text",
        "default": "<p>富文本</p>"
      },
      {
        "type": "textarea",
        "id": "yd-textarea",
        "label": "Text",
        "default": "<p>多行文本</p>"
      },
      {
        "type": "url",
        "id": "yd-url",
        "label": "链接"
      },


    {
      "type": "radio",
      "id": "yd-radio",
      "label": "radio 应用",
      "options": [
        {
          "value": "none",
          "label": "无"
        },
        {
          "value": "red",
          "label": "红色"
        },
        {
          "value": "black",
          "label": "黑色"
        }
      ],
      "default": "none"
    },

    {
      "type": "select",
      "id": "yd-select",
      "label": "select 应用",
      "options": [
        {
          "value": "none",
          "label": "无"
        },
        {
          "value": "red",
          "label": "红色"
        },
        {
          "value": "black",
          "label": "黑色"
        }
      ],
      "default": "none"
    }

    ],
    "presets": [
      {
        "name": "常用文本框",
        "category": "Image"
      }
    ]
  }


{% endschema %}

 

发表评论

共有 0 条评论