隐藏 Shopify 上的目录页面
Hide the catalog page on Shopify
有没有办法在 Shopify 中隐藏目录页面? Here is more detail about the Shopify catalog page.
您能否向我们提供更多有关您想要的内容的详细信息?如果你想从主菜单中删除目录,你需要去在线商店>导航>找到主菜单并从那里删除目录。这将从您的主题中删除名为目录的菜单。
https://help.shopify.com/manual/sell-online/online-store/menus-and-links
如果您不想在目录页面中显示任何产品,您需要转到在线商店 > 主题 > 编辑活动主题的 html/css 并修改 collection.liquid 以删除该部分显示产品。
请提供更多详细信息,以便我们为您提供适当的帮助。
当集合 URL 包含 'all'.
时,您可以添加自动 javascript 重定向到主页
因此在您的主题的集合模板中可能是这样的:
{% if collection.handle == 'all' %}
<script>window.location.href = '{{ shop.url }}';</script>
{% else %}
Usual code for collection template display if this is not the 'all' collection.
{% endif %}
请注意,这不是推荐的做法。
例如,如果您的客户已禁用 Javascript,页面内容将为空白,因为重定向将不起作用。
更好的做法是不在搜索引擎中索引页面,因此如果没有内部 link 并且如果搜索引擎不索引它,就没有人会看到它。
为此,打开 'theme.liquid' 模板,然后将其添加到 <head>
部分:
{% if collection.handle == 'all' %}
<meta name="robots" content="noindex">
{% endif %}
HTH
根据您提供的link:
All Shopify stores have a page at the URL your-store.com/collections/all
that lists all of the visible products in the store. This is the store's catalog page. By default, products on the catalog page are shown in alphabetic order. You can create a collection to control the order in which your products are shown on this page.
如果您想完全隐藏/删除该页面,您需要做一些事情:
- 创建一个集合来控制您的目录页面,as described via that same link,
- 重定向它,以便访问该页面的任何人都被带到其他地方,例如你的主页。您可以使用下面的代码段,基于 this excellent answer for "Redirect[ing] from an HTML page" [或者,在这种情况下,Liquid 模板:]
{%- layout none -%}
{%- assign title = "Nothing to See Here!" -%}
{%- assign url = shop.url -%}
<!DOCTYPE HTML>
<html lang="en-US">
<head>
{%- include 'head-meta' -%}
<meta http-equiv="refresh" content="1;url={{ url }}">
<script type="text/javascript">
window.top.location.href = "{{ url }}"
</script>
</head>
<body>
<h1>{{ page_title }}</h1>
<p>If you are not redirected automatically, follow the <a href="{ url }}">link</a>.</p>
</body>
</html>
- 将其从站点地图中删除。你可以这样做(对于这个集合或任何 Shopify 资源)using my answer here — tl;dr 添加一个 metafield.seo.hidden 值
1
.
有没有办法在 Shopify 中隐藏目录页面? Here is more detail about the Shopify catalog page.
您能否向我们提供更多有关您想要的内容的详细信息?如果你想从主菜单中删除目录,你需要去在线商店>导航>找到主菜单并从那里删除目录。这将从您的主题中删除名为目录的菜单。
https://help.shopify.com/manual/sell-online/online-store/menus-and-links
如果您不想在目录页面中显示任何产品,您需要转到在线商店 > 主题 > 编辑活动主题的 html/css 并修改 collection.liquid 以删除该部分显示产品。
请提供更多详细信息,以便我们为您提供适当的帮助。
当集合 URL 包含 'all'.
时,您可以添加自动 javascript 重定向到主页因此在您的主题的集合模板中可能是这样的:
{% if collection.handle == 'all' %}
<script>window.location.href = '{{ shop.url }}';</script>
{% else %}
Usual code for collection template display if this is not the 'all' collection.
{% endif %}
请注意,这不是推荐的做法。 例如,如果您的客户已禁用 Javascript,页面内容将为空白,因为重定向将不起作用。
更好的做法是不在搜索引擎中索引页面,因此如果没有内部 link 并且如果搜索引擎不索引它,就没有人会看到它。
为此,打开 'theme.liquid' 模板,然后将其添加到 <head>
部分:
{% if collection.handle == 'all' %}
<meta name="robots" content="noindex">
{% endif %}
HTH
根据您提供的link:
All Shopify stores have a page at the URL
your-store.com/collections/all
that lists all of the visible products in the store. This is the store's catalog page. By default, products on the catalog page are shown in alphabetic order. You can create a collection to control the order in which your products are shown on this page.
如果您想完全隐藏/删除该页面,您需要做一些事情:
- 创建一个集合来控制您的目录页面,as described via that same link,
- 重定向它,以便访问该页面的任何人都被带到其他地方,例如你的主页。您可以使用下面的代码段,基于 this excellent answer for "Redirect[ing] from an HTML page" [或者,在这种情况下,Liquid 模板:]
{%- layout none -%}
{%- assign title = "Nothing to See Here!" -%}
{%- assign url = shop.url -%}
<!DOCTYPE HTML>
<html lang="en-US">
<head>
{%- include 'head-meta' -%}
<meta http-equiv="refresh" content="1;url={{ url }}">
<script type="text/javascript">
window.top.location.href = "{{ url }}"
</script>
</head>
<body>
<h1>{{ page_title }}</h1>
<p>If you are not redirected automatically, follow the <a href="{ url }}">link</a>.</p>
</body>
</html>
- 将其从站点地图中删除。你可以这样做(对于这个集合或任何 Shopify 资源)using my answer here — tl;dr 添加一个 metafield.seo.hidden 值
1
.