【发布时间】:2016-10-24 00:00:26
【问题描述】:
有没有办法在 Shopify 中隐藏目录页面? Here is more detail about the Shopify catalog page.
【问题讨论】:
-
Shopiy 在服务器端提供 url 重定向。检查 Shopify 仪表板内导航下的 URL 重定向
标签: e-commerce shopify
有没有办法在 Shopify 中隐藏目录页面? Here is more detail about the Shopify catalog page.
【问题讨论】:
标签: e-commerce shopify
当集合 URL 包含“全部”时,您可以添加一个自动 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,则页面内容将为空白,因为重定向不起作用。
更好的做法是不在搜索引擎中索引页面,所以如果没有内部链接并且搜索引擎不索引它,那么没有人会看到它。
为此,请打开“theme.liquid”模板,然后将其添加到<head> 部分:
{% if collection.handle == 'all' %}
<meta name="robots" content="noindex">
{% endif %}
HTH
【讨论】:
你能告诉我们更多关于你想要什么的细节吗?如果要从主菜单中删除目录,您需要转到在线商店 > 导航 > 找到主菜单并从那里删除目录。这将从您的主题中删除名为目录的菜单。
https://help.shopify.com/manual/sell-online/online-store/menus-and-links
如果您不想在目录页面中显示任何产品,则需要转到在线商店 > 主题 > 编辑活动主题的 html/css 并修改 collection.liquid 以删除显示产品的部分。
请提供更多详细信息,以便我们为您提供适当的帮助。
【讨论】:
<script type="text/javascript"> window.location.replace("http://stackoverflow.com"); </script>
从您提供的链接:
所有 Shopify 商店都有一个位于 URL
your-store.com/collections/all的页面列出了商店中所有可见的产品。 这是商店的目录页面。默认情况下,目录页面上的产品按字母顺序显示。您可以创建一个集合来控制您的产品在此页面上的显示顺序。
如果您想完全隐藏/删除该页面,您需要做一些事情:
{%- 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>
1。【讨论】: