<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to get a list of 100+ blog ids in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/549644#M26675</link>
    <description>&lt;P&gt;In order to display them on the blog post list page, I store the list of all the blog ids registered in hubdb in an array, and use "content_by_ids" to get the content of the corresponding ids.&lt;BR /&gt;However, since the number of blog posts exceeds 100 and the maximum number of posts that can be retrieved by content_by_ids is 100, I am having trouble retrieving all posts.&lt;BR /&gt;I'm trying to get the target id from HubDB and get the content as follows, but is there a good way to get more than 101 articles?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{% set dbRows = hubdb_table_rows(3410151) %}
{% set post_ids = [] %}
{% for row in dbRows %}
  {% do post_ids.append(row.post_id) %}
{% endfor %}

{% set find_contents = content_by_ids(post_ids) %}
{% set page_count = (find_contents|length / post_count_per_page)|round(0, 'floor') %}
{% if find_contents|length % post_count_per_page &amp;gt; 0 %}
  {% set page_count = page_count + 1 %}
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jan 2022 10:18:41 GMT</pubDate>
    <dc:creator>Nao_Mitsuhashi</dc:creator>
    <dc:date>2022-01-04T10:18:41Z</dc:date>
    <item>
      <title>How to get a list of 100+ blog ids</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/549644#M26675</link>
      <description>&lt;P&gt;In order to display them on the blog post list page, I store the list of all the blog ids registered in hubdb in an array, and use "content_by_ids" to get the content of the corresponding ids.&lt;BR /&gt;However, since the number of blog posts exceeds 100 and the maximum number of posts that can be retrieved by content_by_ids is 100, I am having trouble retrieving all posts.&lt;BR /&gt;I'm trying to get the target id from HubDB and get the content as follows, but is there a good way to get more than 101 articles?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{% set dbRows = hubdb_table_rows(3410151) %}
{% set post_ids = [] %}
{% for row in dbRows %}
  {% do post_ids.append(row.post_id) %}
{% endfor %}

{% set find_contents = content_by_ids(post_ids) %}
{% set page_count = (find_contents|length / post_count_per_page)|round(0, 'floor') %}
{% if find_contents|length % post_count_per_page &amp;gt; 0 %}
  {% set page_count = page_count + 1 %}
{% endif %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 10:18:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/549644#M26675</guid>
      <dc:creator>Nao_Mitsuhashi</dc:creator>
      <dc:date>2022-01-04T10:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a list of 100+ blog ids</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/549991#M26683</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/78983"&gt;@Indra&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any clever methods of solving for this?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 20:04:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/549991#M26683</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-01-04T20:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a list of 100+ blog ids</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/550102#M26684</link>
      <description>&lt;P&gt;I would add an offset and a limit to your dbrows, call it a number of times and append them together to recreate your loop. &lt;BR /&gt;I should note, I've not tested this code, but in theory this should still have limit of 300 (up to 500 before you start hitting hubspot call limits if you add a couple more loops), but it will at least boost you from 100 if you have to do it this way.&lt;BR /&gt;&lt;BR /&gt;For example:&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;{% set dbRows = hubdb_table_rows(3410151, "&amp;amp;limit=100") %}
{% set dbRows2 = hubdb_table_rows(3410151, "&amp;amp;offset=100&amp;amp;limit=100") %}
{% set dbRows3 = hubdb_table_rows(3410151, "&amp;amp;offset=200&amp;amp;limit=100") %}

{% set post_ids = [] %}
{% set post_ids2 = [] %}
{% set post_ids3 = [] %}

{% for row in dbRows %}
  {% do post_ids.append(row.post_id) %}
{% endfor %}
{% for row in dbRows2 %}
  {% do post_ids2.append(row.post_id) %}
{% endfor %}
{% for row in dbRows3 %}
  {% do post_ids3.append(row.post_id) %}
{% endfor %}

{% set find_contents = content_by_ids(post_ids) + content_by_ids(post_ids2) + content_by_ids(post_ids3) %}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2022 23:19:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/550102#M26684</guid>
      <dc:creator>Brownstephen101</dc:creator>
      <dc:date>2022-01-04T23:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a list of 100+ blog ids</title>
      <link>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/551037#M26703</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/191804"&gt;@Brownstephen101&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the code example and for the footnote about the upper limit.&lt;BR /&gt;I'll try to deal with it in the way.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jan 2022 06:40:52 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/How-to-get-a-list-of-100-blog-ids/m-p/551037#M26703</guid>
      <dc:creator>Nao_Mitsuhashi</dc:creator>
      <dc:date>2022-01-06T06:40:52Z</dc:date>
    </item>
  </channel>
</rss>

