自定义Shopify中的Default_pagination编号样式
我正在尝试自定义Default_Pagination过滤器的数字。我需要在数字上显示一个盒子。因此,为此,我需要为数字创建一个自定义类,并更改CSS中的样式。但是我不知道该怎么做。一点点帮助将不胜感激。
这是我的代码:
<div class="container">
{% paginate collection.products by 5 %}
{% for product in collection.products %}
<a href="{{ product.url }}"><img src="{{ product.featured_image | img_url: 'medium' }}" alt="{{ product.title }}">
<figcaption>{{ product.title }}
{% if product.compare_at_price_max > 0 %}
<span>{{ product.compare_at_price_max | money }}</span>
<span>{{ product.price | money }}</span>
{% else %}
<span>{{ product.price | money }}</span>
{% endif %}
</figcaption>
</a>
{% endfor %}
{{ paginate | default_pagination: next: '>', previous: '<' }}
{% endpaginate %}
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
而不是使用Shopify Liquid
default_pagination
查看液体分页对象有关更多信息。
然后,按照您想要的方式进行造型应该很容易。如果您需要帮助,请发表评论。我很高兴提供帮助:)
Instead of using Shopify Liquid's
default_pagination
filter which creates a boilerplate pagination component for you, you can create a fully customizable pagination like this:Check out the Liquid paginate object for more information.
Styling it the way you want should be quite easy then. Comment if you need help with that. I'm happy to help :)