我正在Shopify上使用Debut主题,并且想要自定义页脚(我的网站)
customize主题中有一些选项可添加和删除页脚的列部分,但是没有选项可将自定义html块添加为列之一。如何将自定义HTML添加到页脚列的选项列表中?:
谢谢你的帮助!
打开/sections/footer.liquid
然后向blocks
数组添加一个新的section块,此代码应为您提供一个基本的起点:
{
"type": "html_content",
"name": "HTML Content",
"settings": [
{
"type": "html",
"id": "html_area",
"label": "Custom HTML",
"default": "<div><p>Some HTML content</p></div>"
}
]
}
然后,要显示内容,您需要为块中的html_content
类型添加一个新的类型检查{%- case block.type -%}
,如下所示:
{%- case block.type -%}
{%- when 'newsletter' -%}
.
.
.
{%- when 'text' -%}
.
.
.
{%- when 'link_list' -%}
.
.
.
{%- when 'html_content' -%}
{{ block.settings.html_area }}
{%- endcase -%}
保存更改并刷新主题定制器后,您应该能够在页脚部分看到新的内容类型。
对于所有主题部分的输入类型,请参考此文档。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句