Squarespace 自定义产品 Post 类型
Squarespace Custom Product Post Type
我正在考虑为产品创建不同的模板(不是具有不同的功能,而是具有不同的 html 组织和 css),因为标准 "pic on the left and data on the right" 对于制作精良的以用户为中心的电子商务来说是不够的。
我尝试了自定义post类型,但它们是博客post,无法访问产品数据。
在我的自定义 product.conf
中添加了我的自定义 post 数据
"acceptTypes" : ["store_item", "custom-product-item"]
但是很明显。它不会工作。
也许如果我可以访问 store_item 可以更容易地做到这一点,但我在回购协议中找不到。
有人有什么建议吗?
不幸的是,虽然过去可以创建自定义 post 类型的产品,但在过去一年左右就不再可行了。
如果您想为产品创建自己的模板,您需要用您自己的文件覆盖 products.list
and/or products.item
文件。通过将它们放在您的 /collections
文件夹中,它将覆盖系统默认的。
这意味着您必须完全从头开始编写。这里有一些可能有用的资源(尽管已经过时):
- http://www.bcarroll.us/developer-platform-tutorials/2014/10/20/products-pages
- https://answers.squarespace.com/questions/57343/productsitem-for-adirondack-template.html
覆盖 products.item 后,如果您想为不同的产品使用不同的模板,您可以这样做:
{.equal? item.urlId "myurlid1"}
{@|apply products1.block}
{.or equal? item.urlId "myurlid2"}
{@|apply products2.block}
{.or}
etc.
我正在考虑为产品创建不同的模板(不是具有不同的功能,而是具有不同的 html 组织和 css),因为标准 "pic on the left and data on the right" 对于制作精良的以用户为中心的电子商务来说是不够的。
我尝试了自定义post类型,但它们是博客post,无法访问产品数据。
在我的自定义 product.conf
中添加了我的自定义 post 数据
"acceptTypes" : ["store_item", "custom-product-item"]
但是很明显。它不会工作。
也许如果我可以访问 store_item 可以更容易地做到这一点,但我在回购协议中找不到。
有人有什么建议吗?
不幸的是,虽然过去可以创建自定义 post 类型的产品,但在过去一年左右就不再可行了。
如果您想为产品创建自己的模板,您需要用您自己的文件覆盖 products.list
and/or products.item
文件。通过将它们放在您的 /collections
文件夹中,它将覆盖系统默认的。
这意味着您必须完全从头开始编写。这里有一些可能有用的资源(尽管已经过时):
- http://www.bcarroll.us/developer-platform-tutorials/2014/10/20/products-pages
- https://answers.squarespace.com/questions/57343/productsitem-for-adirondack-template.html
覆盖 products.item 后,如果您想为不同的产品使用不同的模板,您可以这样做:
{.equal? item.urlId "myurlid1"}
{@|apply products1.block}
{.or equal? item.urlId "myurlid2"}
{@|apply products2.block}
{.or}
etc.