0

我想在我的 CSS 网格中显示我没有特色的帖子。我已经 featured = false在我的 squarespace 查询中尝试了该参数,但它没有用。

我发现这篇文章有类似的问题:http ://answers.squarespace.com/questions/18544/i-have-a-query-and-my-list-on-the-same-page-i-need-the-两个地方都不能有的物品

我尝试了不同的解决方案....

      <squarespace:query collection="blog" limit="4" featured="false">    
        {.repeated section items}
           {.if starred}
              <!-- skip featured items -->
           {.or}
           <div class="col-1-3">
              <div class="module-container">
                 {.main-image?}  
                     <a href="{fullUrl}">
                        <img {@|image-meta} />
                      </a>
                 {.end}
                 <div class="caption-container">
                        <small>{categories}</small>
                        <a href="{fullUrl}><h2 class="caption">{title}</h2</a>
                    </div>
                </div>
            </div>  
       {.end}
{.end}

但是......即使我提出{.if starred}声明......需要在那之后我的查询已被限制为帖子总数,因此它不会显示限制数量,但更少的因为计算我不想要的精选帖子显示。

有什么提示吗?

4

1 回答 1

0

有几个选项。

选项 1(使用 JS): 使用 AJAX 抓取内容并将其过滤为 4 篇没有特色的博客文章。

选项 2(使用 JS 或 CSS): 创建一个更大的查询并使用 CSS(隐藏)或 JS(删除)在第 4 个之后的博客文章

选项 3(带有摘要块): 另一个选项是使用摘要块并为您的非精选帖子添加特定类别并使用该类别过滤它们。

于 2015-03-01T22:49:02.797 回答