编辑模板代码

您可以编辑模板的代码。

步骤:

PC:

  1. 在 Shopify 后台中,转到在线商店 > 模板

  1. 点击操作 > 编辑代码

代码编辑器的左侧显示了模板文件的目录,右侧显示了用于查看和编辑文件的空间。

可以通过点击展开图标来展开代码编辑器以填充屏幕:

可以通过点击折叠图标来将页面恢复正常:

点击左侧目录中的文件时,它将在代码编辑器中打开。您可以一次打开和编辑多个文件。您修改的所有文件都会在文件名旁边显示一个圆点:

这可以帮助您跟踪已做出更改的地方。

苹果系统:

  1. 在 Shopify 应用中,轻触商店

  2. 销售渠道部分,轻触在线商店

  3. 轻触管理模板

  1. 点击操作 > 编辑代码

代码编辑器的左侧显示了模板文件的目录,右侧显示了用于查看和编辑文件的空间。

可以通过点击展开图标来展开代码编辑器以填充屏幕:

可以通过点击折叠图标来将页面恢复正常:

点击左侧目录中的文件时,它将在代码编辑器中打开。您可以一次打开和编辑多个文件。您修改的所有文件都会在文件名旁边显示一个圆点:

这可以帮助您跟踪已做出更改的地方。

安卓系统:

  1. 在 Shopify 应用中,轻触商店

  2. 销售渠道部分,轻触在线商店

  3. 轻触管理模板

  1. 点击操作 > 编辑代码

代码编辑器的左侧显示了模板文件的目录,右侧显示了用于查看和编辑文件的空间。

可以通过点击展开图标来展开代码编辑器以填充屏幕:

可以通过点击折叠图标来将页面恢复正常:

点击左侧目录中的文件时,它将在代码编辑器中打开。您可以一次打开和编辑多个文件。您修改的所有文件都会在文件名旁边显示一个圆点:

这可以帮助您跟踪已做出更改的地方。

回退到旧版模板

如果您更改了模板文件并需要恢复,您可以将各个 .liquid 文件回退到执行更改之前的某个时间和日期。

PC:

  1. 在 Shopify 后台中,转到在线商店 > 模板

  2. 找到要编辑的模板,然后点击操作 > 编辑代码

  1. 模板标头下,点击最近编辑的一个 .liquid 文件。

  1. 点击 .liquid 文件名旁边的旧版本

  1. 点击下拉菜单以选择旧版本。点击日期戳可将代码回退到该保存的版本。

  1. 可选:点击预览,查看错误是否已修复。

苹果系统:

  1. 在 Shopify 应用中,轻触商店

  2. 销售渠道部分中,轻触在线商店

  3. 轻触 Manage themes(管理模板)。

  4. 找到要编辑的模板,然后点击操作 > 编辑代码

  1. 模板标头下,点击最近编辑的一个 .liquid 文件。

  1. 点击 .liquid 文件名旁边的旧版本

  1. 点击下拉菜单以选择旧版本。点击日期戳可将代码回退到该保存的版本。

  1. 可选:点击预览,查看错误是否已修复。

安卓系统:

  1. 在 Shopify 应用中,轻触商店

  2. 销售渠道部分中,轻触在线商店

  3. 轻触 Manage themes(管理模板)。

  4. 找到要编辑的模板,然后点击操作 > 编辑代码

  1. 模板标头下,点击最近编辑的一个 .liquid 文件。

  1. 点击 .liquid 文件名旁边的旧版本

  1. 点击下拉菜单以选择旧版本。点击日期戳可将代码回退到该保存的版本。

  1. 可选:点击预览,查看错误是否已修复。

Shopify商户官网原文详情:

Edit your theme code

You can edit the code for your theme.

Steps:

PC:

  1. From your Shopify admin, go to Online Store > Themes.

  1. 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:

  1. From the Shopify app, tap Store.

  2. In the Sales channels section, tap Online Store.

  3. Tap Manage themes.

  1. 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:

  1. From the Shopify app, tap Store.

  2. In the Sales channels section, tap Online Store.

  3. Tap Manage themes.

  1. 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:

  1. From your Shopify admin, go to Online Store > Themes.

  2. Find the theme you want to edit, and then click Actions > Edit code.

  1. Under the Templates header, click into one of the .liquid files you have edited recently.

  1. Click Older versions next to the .liquid file name.

  1. Click the drop-down menu to select an older version. Clicking a datestamp will roll the code back to that saved version.

  1. Optional: click Preview and see if the error was fixed.

iPhone:

  1. From the Shopify app, tap Store.

  2. In the Sales channels section, tap Online Store.

  3. Tap Manage themes.

  4. Find the theme you want to edit, and then click Actions > Edit code.

  1. Under the Templates header, click into one of the .liquid files you have edited recently.

  1. Click Older versions next to the .liquid file name.

  1. Click the drop-down menu to select an older version. Clicking a datestamp will roll the code back to that saved version.

  1. Optional: click Preview and see if the error was fixed.

Androi:

  1. From the Shopify app, tap Store.

  2. In the Sales channels section, tap Online Store.

  3. Tap Manage themes.

  4. Find the theme you want to edit, and then click Actions > Edit code.

  1. Under the Templates header, click into one of the .liquid files you have edited recently.

  1. Click Older versions next to the .liquid file name.

  1. Click the drop-down menu to select an older version. Clicking a datestamp will roll the code back to that saved version.

  1. Optional: click Preview and see if the error was fixed.

文章内容来源:Shopify商户官方网站


(本文内容根据网络资料整理,出于传递更多信息之目的,不代表连连国际赞同其观点和立场)