编辑模板代码
您可以编辑模板的代码。
步骤:
PC:
在 Shopify 后台中,转到在线商店 > 模板。
点击操作 > 编辑代码。
代码编辑器的左侧显示了模板文件的目录,右侧显示了用于查看和编辑文件的空间。
可以通过点击展开图标来展开代码编辑器以填充屏幕:
可以通过点击折叠图标来将页面恢复正常:
点击左侧目录中的文件时,它将在代码编辑器中打开。您可以一次打开和编辑多个文件。您修改的所有文件都会在文件名旁边显示一个圆点:
这可以帮助您跟踪已做出更改的地方。
苹果系统:
在 Shopify 应用中,轻触商店。
在销售渠道部分,轻触在线商店。
轻触管理模板。
点击操作 > 编辑代码。
代码编辑器的左侧显示了模板文件的目录,右侧显示了用于查看和编辑文件的空间。
可以通过点击展开图标来展开代码编辑器以填充屏幕:
可以通过点击折叠图标来将页面恢复正常:
点击左侧目录中的文件时,它将在代码编辑器中打开。您可以一次打开和编辑多个文件。您修改的所有文件都会在文件名旁边显示一个圆点:
这可以帮助您跟踪已做出更改的地方。
安卓系统:
在 Shopify 应用中,轻触商店。
在销售渠道部分,轻触在线商店。
轻触管理模板。
点击操作 > 编辑代码。
代码编辑器的左侧显示了模板文件的目录,右侧显示了用于查看和编辑文件的空间。
可以通过点击展开图标来展开代码编辑器以填充屏幕:
可以通过点击折叠图标来将页面恢复正常:
点击左侧目录中的文件时,它将在代码编辑器中打开。您可以一次打开和编辑多个文件。您修改的所有文件都会在文件名旁边显示一个圆点:
这可以帮助您跟踪已做出更改的地方。
回退到旧版模板
如果您更改了模板文件并需要恢复,您可以将各个 .liquid
文件回退到执行更改之前的某个时间和日期。
PC:
在 Shopify 后台中,转到在线商店 > 模板。
找到要编辑的模板,然后点击操作 > 编辑代码。
在模板标头下,点击最近编辑的一个 .liquid 文件。
点击
.liquid
文件名旁边的旧版本。
点击下拉菜单以选择旧版本。点击日期戳可将代码回退到该保存的版本。
可选:点击预览,查看错误是否已修复。
苹果系统:
在 Shopify 应用中,轻触商店。
在销售渠道部分中,轻触在线商店。
轻触 Manage themes(管理模板)。
找到要编辑的模板,然后点击操作 > 编辑代码。
在模板标头下,点击最近编辑的一个 .liquid 文件。
点击
.liquid
文件名旁边的旧版本。
点击下拉菜单以选择旧版本。点击日期戳可将代码回退到该保存的版本。
可选:点击预览,查看错误是否已修复。
安卓系统:
在 Shopify 应用中,轻触商店。
在销售渠道部分中,轻触在线商店。
轻触 Manage themes(管理模板)。
找到要编辑的模板,然后点击操作 > 编辑代码。
在模板标头下,点击最近编辑的一个 .liquid 文件。
点击
.liquid
文件名旁边的旧版本。
点击下拉菜单以选择旧版本。点击日期戳可将代码回退到该保存的版本。
可选:点击预览,查看错误是否已修复。
Shopify商户官网原文详情:
Edit your theme code
You can edit the code for your theme.
Steps:
PC:
From your Shopify admin, go to Online Store > Themes.
Click Actions > Edit code.
The code editor shows a directory of theme files on the left, and a space to view and edit the files on the right.
You can expand the code editor to fill the screen by clicking the expand icon:
You can return the page to normal by clicking the collapse icon:
When you click a file in the directory on the left, it opens in the code editor. You can open and edit multiple files at once. Any files that you modify will show a dot next to the file name:
This can help you to keep track of where you have made changes.
iPhone:
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Click Actions > Edit code.
The code editor shows a directory of theme files on the left, and a space to view and edit the files on the right.
You can expand the code editor to fill the screen by clicking the expand icon:
You can return the page to normal by clicking the collapse icon:
When you click a file in the directory on the left, it opens in the code editor. You can open and edit multiple files at once. Any files that you modify will show a dot next to the file name:
This can help you to keep track of where you have made changes.
Android:
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Click Actions > Edit code.
The code editor shows a directory of theme files on the left, and a space to view and edit the files on the right.
You can expand the code editor to fill the screen by clicking the expand icon:
You can return the page to normal by clicking the collapse icon:
When you click a file in the directory on the left, it opens in the code editor. You can open and edit multiple files at once. Any files that you modify will show a dot next to the file name:
This can help you to keep track of where you have made changes.
Roll back to an older version of your theme
If you've changed theme files and need to revert them, you can roll back
.liquid
files individually to a time and date before you made the changes.PC:
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code.
Under the Templates header, click into one of the .liquid files you have edited recently.
Click Older versions next to the
.liquid
file name.
Click the drop-down menu to select an older version. Clicking a datestamp will roll the code back to that saved version.
Optional: click Preview and see if the error was fixed.
iPhone:
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Find the theme you want to edit, and then click Actions > Edit code.
Under the Templates header, click into one of the .liquid files you have edited recently.
Click Older versions next to the
.liquid
file name.
Click the drop-down menu to select an older version. Clicking a datestamp will roll the code back to that saved version.
Optional: click Preview and see if the error was fixed.
Androi:
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Find the theme you want to edit, and then click Actions > Edit code.
Under the Templates header, click into one of the .liquid files you have edited recently.
Click Older versions next to the
.liquid
file name.
Click the drop-down menu to select an older version. Clicking a datestamp will roll the code back to that saved version.
Optional: click Preview and see if the error was fixed.
文章内容来源:Shopify商户官方网站