拓展您的模板Shopify模板
2022-05-24 15:06:04
拓展您的模板
Shopify模板给予很多设定和自定义选择项。可是,您的模板很有可能不给予一些作用,或是您很有可能仅仅想进一步自定义模板。例如,您也许期待在门店中表明商品评价,这可以根据安装应用来完成。假如要拓展您的模板作用,您可以依照下列方法开展拓展。
本页有关主题风格
添加自定义HTML或Liquid
安装应用
编辑模板代码
添加自定义HTML或Liquid
一些模板给予一些设定,让您可以添加HTML或Liquid代码的代码精彩片段,这种代码可在包括有关设定的模板、系统分区或块中展现。根据这种设定,您可以安全性地将自定义代码添加到在线商店,而不用立即编辑模板的代码,这有利于保证您的模板合乎在线升级标准。
您可以将这种设定用以下列每日任务:
应用自定义Liquid系统分区插进合适您工作的Liquid自变量。例如,您可以在商品界面上包括货运物流现行政策。
应用自定义Liquid系统分区添加将运用与模板集成化需要的代码。
若要掌握模板是不是有自定义HTML或Liquid选择项,客户程序模板的文本文档。
Liquid设定仅容许您浏览比较有限的Liquid目标和标识。若要掌握可在Liquid设定中采用的另一半和标识,客户程序Shopify.dev上的Liquid设定文本文档。
安装应用
您可以安装应用,以向您的模板中添加作用和集成化。您可在Shopify应用商城上搜索运用。
在线商店应用可以利用下列方法与您的模板集成化:
做为运用块:根据运用块,您可以精确地在控制模块时要应用运用作用的部位添加运用作用。您可以根据模板编辑器添加、删掉和自定义运用块。
应用块只有与OnlineStore2.0模板一起应用。假如您应用复古时尚模板,那麼您应当阅读文章运用叙述和文本文档,掌握该运用是不是与您的模板兼容。
做为运用置入:运用置入是软件带来的原素,可在您的模板中波动或以累加层的方式表明,也可在顾客看不见的情形下将代码添加到您的在线商店。您可以根据模板编辑器开启、禁止使用和自定义运用置入。
根据变更您的模板代码:一些运用立即将代码引入您的模板代码中,便于为您的模板添加作用。您可以应用应用设置或使用模板编辑器自定义运用。
假如您的模板给予CustomLiquid一部分,您也许可以将您的运用代码添加到模板编辑器中的“自定义Liquid”一部分,而不是立即编辑您的模板代码。
编辑模板代码
您可以根据编辑模板代码来对在线商店开展详尽变更。模板文件包含Liquid(Shopify的模板语言表达),及其HTML、CSS、JSON和JavaScript。仅有在您掌握HTML和CSS,并具有Liquid的有关基本知识时,才可编辑模板的代码。
假如您编辑模板的代码,则有可能会使其不符在线升级的标准。仅有在没法应用HTML或Liquid设定或Shopify运用开展所需变更的情形下,才应编辑模板的代码。
假如您应用Shopify的完全免费模板,Shopify适用精英团队可以协助您对模板代码开展一些自定义。相关可以用自定义项的目录,客户程序模板的文本文档。深入分析对于模板的适用。
您可以依照下列方法编辑您的模板代码:
立即在Shopify后台管理中编辑代码。
应用ShopifyCLI和ShopifyGitHub集成化等开发环境在当地编辑模板。
扩展您的业务流程
假如您想添加自定义作用或代码,但并没有应用HTML、CSS和JavaScript开发网站的工作经验,请考虑到聘用Shopify权威专家。
Shopify商家官方网站全文详细信息:
Extendyourtheme
Shopifythemesoffermanysettingsandcustomizationoptions.However,theremightbesomefeaturesthatyourthemedoesntoffer,oryoumightjustwanttofurthercustomizeyourtheme.Forexample,youmightwanttodisplayproductreviewsinyourstore,whichyoucandobyinstallinganapp.Ifyouwanttoextendthefunctionalityofyourtheme,youcandosointhefollowingways.
Onthispage
AddcustomHTMLorLiquid
Installanapp
Edityourthemecode
AddcustomHTMLorLiquid
SomethemesoffersettingsthatletyouaddsnippetsofHTMLorLiquidcodethatcanberenderedinthetemplate,section,orblockthatcontainsthesetting.Thesesettingsletyousafelyaddcustomcodetoyouronlinestorewithouteditingyourthemescodedirectly,whichhelpstoensurethatyourthemeiseligibleforautomaticupgrades.
Youmightusethesesettingsforthefollowingtasks:
UseaCustomLiquidsectiontoinsertLiquidvariableswheretheymakesenseforyourbusiness.Forexample,youmightincludeyourshippingpolicyonyourproductpage.
UseaCustomLiquidsectiontoaddthecodethatsrequiredtointegrateanappwithyourtheme.
TolearnwhetheryourthemehasacustomHTMLorLiquidoption,refertoyourthemesdocumentation.
LiquidsettingsonlyallowyoutoaccesslimitedLiquidobjectsandtags.TolearnabouttheobjectsandtagsthatyoucanuseinaLiquidsetting,refertotheLiquidsettingdocumentationonShopify.dev.
Installanapp
Youcaninstallappstoaddfeaturesandintegrationstoyourtheme.YoucanfindappsontheShopifyAppStore.
OnlineStoreappscanintegratewithyourthemeinthefollowingways:
Asanappblock:Appblocksletyouaddappfunctionalityexactlywhereyouwanttouseitinyourtheme.Appblockscanbeadded,removed,andcustomizedthroughthethemeeditor.
AppblockscanonlybeusedwithOnlineStore2.0themes.Ifyouuseavintagetheme,thenyoushouldreadtheapplistinganddocumentationtounderstandwhethertheappiscompatiblewithyourtheme.
Asanappembed:Appembedsareapp-providedelementsthatfloatorappearasanoverlayinyourtheme,oraddcodetoyouronlinestorewithoutbeingvisibletoyourcustomers.Appembedscanbeenabled,disabled,andcustomizedthroughthethemeeditor.
Byalteringyourthemecode:Someappsinjectcodedirectlyintoyourthemescodetoaddfunctionalitytoyourtheme.Youmightcustomizetheappusingtheappsettings,orusingthethemeeditor.
IfyourthemeoffersaCustomLiquidsection,thenyoumightbeabletoaddyourappcodeintoaCustomLiquidsectioninthethemeeditorinsteadofeditingyourthemecodedirectly.
Edityourthemecode
Youcanedityourthemecodetomakedetailedchangestoyouronlinestore.ThemefilescontainLiquid,Shopifystemplatinglanguage,alongwithHTML,CSS,JSON,andJavaScript.EditthecodeforathemeonlyifyouknowHTMLandCSS,andhaveabasicunderstandingofLiquid.
Ifyouedityourthemescode,thenyoumightmakeitineligibleforautomaticupgrades.YoushouldonlyedityourthemescodeifyoucantmakethechangesthatyouneedusinganHTMLorLiquidsettingoraShopifyapp.
IfyouuseafreethemefromShopify,thenShopifySupportcanhelpyoutomakecertaincustomizationstoyourthemecode.Refertoyourthemesdocumentationforalistofavailablecustomizations.Learnmoreaboutsupportforthemes.
Youcanedityourthemecodeinthefollowingways:
EditcodedirectlyintheShopifyadmin.
EdityourthemelocallyusingdevelopmenttoolslikeShopifyCLIandtheShopifyGitHubintegration.
Growyourbusiness
IfyouwanttoaddcustomfeaturesorcodebutdonthaveexperiencedevelopingwebsiteswithHTML,CSS,andJavaScript,thenconsiderhiringaShopifyexpert.
文章内容由来:Shopify商户官方网站
部分文章来源于网络,如有侵权,请联系 caihong@youzan.com 删除。