找到您要編輯的模板,然后點(diǎn)擊操作 > 編輯代碼。
在 Templates 目錄中,點(diǎn)擊添加新模板。
為名為 list-collections 的頁(yè)面創(chuàng)建新模板。
提示:Supply 模板附帶一個(gè)預(yù)先構(gòu)建的可用 page.list-collections
文件。
刪除新 page.list-collections
文件中的現(xiàn)有代碼。找到下方的模板代碼,復(fù)制該代碼并將其粘貼到您的 page.list-collections
文件中。
點(diǎn)擊保存。
此自定義設(shè)置的代碼因您的模板而異。點(diǎn)擊模板的對(duì)應(yīng)按鈕,然后將代碼復(fù)制并粘貼到您的 page.list-collections
文件中:
Boundless
Brooklyn
Debut
Minimal
Narrative
Simple
Venture
復(fù)制代碼。
liquid {% comment %} Featuring collections on a page using a menu https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page {% endcomment %} {%- assign grid_item_width = 'small--one-half medium--one-third large-up--one-quarter' -%} {%- case linklists[page.handle].links.size -%} {%- when 2 -%} {%- assign grid_item_width = 'medium-up--one-half' -%} {%- when 3 -%} {%- assign grid_item_width = 'small--one-half medium-up--one-third' %} {%- else -%} {%- assign grid_item_width = 'small--one-half medium--one-third large-up--one-quarter' %} {%- endcase -%} <div > <header> <h1>{{ page.title }}</h1> </header> <div > {{ page.content }} </div> <div > {%- for link in linklists[page.handle].links -%} {%- if link.type == 'collection_link' -%} {%- assign featured = link.object.handle -%} {%- include 'collection-grid-item', collection: collections[featured] -%} {%- endif -%} {%- endfor -%} </div> </div>
將代碼粘貼到 page.list-collections
文件中。
Feature a subset of collections on a page
below and copy and paste the code in yourpage.list-collections
file.Click Save.
Select your theme
The code for this customization varies depending on your theme. Click the button for your theme before copying and pasting it into your
.list-collections
file:
Boundless
Brooklyn
Debut
Minimal
Narrative
Simple
Venture
Code for Boundless
Copy the code.
liquid {% comment %} Featuring collections on a page using a menu https://shopify-dev.com/tutorials/feature-a-subset-of-collections-on-a-page {% endcomment %} {%- assign grid_item_width = 'small--one-half medium--one-third large-up--one-quarter' -%} {%- case linklists[page.handle].links.size -%} {%- when 2 -%} {%- assign grid_item_width = 'medium-up--one-half' -%} {%- when 3 -%} {%- assign grid_item_width = 'small--one-half medium-up--one-third' %} {%- else -%} {%- assign grid_item_width = 'small--one-half medium--one-third large-up--one-quarter' %} {%- endcase -%} <div > <header> <h1>{{ page.title }}</h1> </header> <div > {{ page.content }} </div> <div > {%- for link in linklists[page.handle].links -%} {%- if link.type == 'collection_link' -%} {%- assign featured = link.object.handle -%} {%- include 'collection-grid-item', collection: collections[featured] -%} {%- endif -%} {%- endfor -%} </div> </div>
Paste the code into the
page.list-collections
file.
特別聲明:以上文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),不代表ESG跨境電商觀(guān)點(diǎn)或立場(chǎng)。如有關(guān)于作品內(nèi)容、版權(quán)或其它問(wèn)題請(qǐng)于作品發(fā)表后的30日內(nèi)與ESG跨境電商聯(lián)系。
二維碼加載中...
使用微信掃一掃登錄
使用賬號(hào)密碼登錄
平臺(tái)顧問(wèn)
微信掃一掃
馬上聯(lián)系在線(xiàn)顧問(wèn)
小程序
ESG跨境小程序
手機(jī)入駐更便捷
返回頂部