我正在使用HubSpot的标记语言HubL . 我想获得博客帖子的总数用于分页目的 .
我正在使用"Variables in blog post, and blog listing templates"从here执行此操作 . 这是我有多远:
{% if next_page_num %}
{{ last_page_num + 1 }} of {{ contents|length - 1 }}
{% endif%}
不幸的是,代码中的“内容|长度”部分仅计算您在页面上指定的博客帖子数量(在我的情况下只显示12篇博文),我不知道如何获得整体总数 .
有谁知道如何做到这一点?
1 回答
你可以用这个变量做到这一点:
我在这里找到了答案:(http://inbound.org/question/view/has-anyone-added-numeric-pagination-to-a-cos-blog) .