如何从特色产品和 Bigcartel 中的类别导航中隐藏特定类别
How can I hide a specific category from the Featured Products and the category nav in Bigcartel
我已经使用 Luna 主题建立了一个 Bigcartel 网站。我的客户一直在卖家具。他现在还想举办艺术家展览并在他的网站上出售这些作品。问题是他不希望这两个群体混在一起。
我想创建将从特色产品列表和类别导航中隐藏的类别。然后,我们将 link 从名为 "exhibitions" 的自定义页面手动转到每个艺术家的类别页面。
似乎应该有一个简单的变量,它只会隐藏类别链接而不是实际的类别页面。
我希望这是有道理的。非常感谢。我也愿意用不同的方法来解决这个问题,但这似乎是可行的方法。
这是主页...上面有特色产品和类别导航:http://www.otherspacela.com/products
迪伦
要在导航中隐藏特定类别,您需要编写 if
语句...
{% if category.permalink != 'seating' and category.permalink != 'lighting' %}
{% endif %}
这将隐藏座位和照明类别。要实现这一点,请找到以下代码(靠近家具页面的顶部)
<ul>
<li class="{% if page.full_url contains '/products' %}selected{% endif %}"><a href="/products">All</a></li>
{% for category in categories.active %}
<li class="page {% if page.full_url contains category.url %}selected{% endif %}">{{ category | link_to }}</li>
{% endfor %}
</ul>
像这样修改该代码的第 4 行,一切就绪:
<ul>
<li class="{% if page.full_url contains '/products' %}selected{% endif %}"><a href="/products">All</a></li>
{% for category in categories.active %}
{% if category.permalink != 'seating' and category.permalink != 'lighting' %}
<li class="page {% if page.full_url contains category.url %}selected{% endif %}">{{ category | link_to }}</li>
{% endif %}
{% endfor %}
</ul>
我已经使用 Luna 主题建立了一个 Bigcartel 网站。我的客户一直在卖家具。他现在还想举办艺术家展览并在他的网站上出售这些作品。问题是他不希望这两个群体混在一起。
我想创建将从特色产品列表和类别导航中隐藏的类别。然后,我们将 link 从名为 "exhibitions" 的自定义页面手动转到每个艺术家的类别页面。
似乎应该有一个简单的变量,它只会隐藏类别链接而不是实际的类别页面。
我希望这是有道理的。非常感谢。我也愿意用不同的方法来解决这个问题,但这似乎是可行的方法。
这是主页...上面有特色产品和类别导航:http://www.otherspacela.com/products
迪伦
要在导航中隐藏特定类别,您需要编写 if
语句...
{% if category.permalink != 'seating' and category.permalink != 'lighting' %}
{% endif %}
这将隐藏座位和照明类别。要实现这一点,请找到以下代码(靠近家具页面的顶部)
<ul>
<li class="{% if page.full_url contains '/products' %}selected{% endif %}"><a href="/products">All</a></li>
{% for category in categories.active %}
<li class="page {% if page.full_url contains category.url %}selected{% endif %}">{{ category | link_to }}</li>
{% endfor %}
</ul>
像这样修改该代码的第 4 行,一切就绪:
<ul>
<li class="{% if page.full_url contains '/products' %}selected{% endif %}"><a href="/products">All</a></li>
{% for category in categories.active %}
{% if category.permalink != 'seating' and category.permalink != 'lighting' %}
<li class="page {% if page.full_url contains category.url %}selected{% endif %}">{{ category | link_to }}</li>
{% endif %}
{% endfor %}
</ul>