2016-02-19 66 views
0

我在Hubspot COS網站上工作,我需要能夠在博客帖子上運行自定義查詢,並在主頁和側邊欄的模塊中顯示這些博客文章的列表在網站上。用於查詢博客帖子的Hubspot自定義模塊

我從哪裏開始?我嘗試過使用RSS模塊,但它並不足以滿足我的需求。

如果您有任何建議,將不勝感激。謝謝!

+0

是基於主題的RSS不夠具體提要HTTP://knowledge.hubspot.com/articles/kcs_article/cos-blog/how-如果不是的話,你是否有一組示例文章+查詢? –

回答

1

我能夠使用blog_recent_topic_posts()來解決這個問題:?

<div class="row-fluid"> 

{% set posts = blog_recent_topic_posts('3904474513', 'featured-resource', 3) %} 
{% for post in posts %} 
    {% set topics = post.topic_list %} 

    <div class="span4 resource"> 
     <div class="resource-icon{% for topic in topics %} {{ topic.slug }}{% endfor %}"></div> 
     <img src="{{ post.featured_image }}" alt="{{ post.name }}"> 
     <div class="resource-text"> 
      <p class="r-type"> 
      {% for topic in topics %} 
       {% unless topic == 'featured resource' %} 
        {{ topic.name }} 
       {% endunless %} 
      {% endfor %}  
      </p> 
      <h3 class="r-title"><a href="{{ post.absolute_url }}">{{ post.name }}</a></h3> 
     </div> 
    </div> 

{% endfor %} 

</div> 
相關問題