<?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 Re: Blog Pagination – show more pages in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385916#M19533</link>
    <description>&lt;P&gt;That looks very promising! Thank you so much, I'll try that right now!&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2020 09:25:27 GMT</pubDate>
    <dc:creator>eyeson</dc:creator>
    <dc:date>2020-11-12T09:25:27Z</dc:date>
    <item>
      <title>Blog Pagination – show more pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385240#M19495</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling with adding more pages to my pagination (as long as there are more available). Now, only the current and next page is shown. I want to show 2-3 pages in advance and maybe even the last page like in the Forum here:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-11-10 um 10.16.56.png" style="width: 333px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/34080i16A82F59FCAAE3D5/image-dimensions/333x50?v=v2" width="333" height="50" role="button" title="Bildschirmfoto 2020-11-10 um 10.16.56.png" alt="Bildschirmfoto 2020-11-10 um 10.16.56.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;        &amp;lt;div class="pagination wrapper flex-row space-between"&amp;gt;
                    {% if not simple_list_page %}
                    &amp;lt;div class="pages-navigation flex-row align-center"&amp;gt;
                      
                        {% if current_page_num &amp;gt; 1 %}
                        {% set previous = current_page_num - 1 %}
                        &amp;lt;a rel="nofollow" href="{{ blog_page_link(previous) }}"&amp;gt;
                            &amp;lt;span class="btn"&amp;gt;&amp;lt;i class="fa fa-angle-double-left" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;
                        &amp;lt;/a&amp;gt;
                        {% endif %} {% if current_page_num %}
                        &amp;lt;a href="{{ content.post_slug }}" class="page-number btn current"&amp;gt;
                            &amp;lt;span&amp;gt;{{ current_page_num }}&amp;lt;/span&amp;gt;
                        &amp;lt;/a&amp;gt;
                        {% endif %} {% if next_page_num %}
                        &amp;lt;a href="{{ blog_page_link(next_page_num) }}" class="page-number btn"&amp;gt;
                            &amp;lt;span&amp;gt;{{next_page_num }}&amp;lt;/span&amp;gt;
                        &amp;lt;/a&amp;gt;
                        &amp;lt;a rel="nofollow" href="{{ blog_page_link(next_page_num) }}"&amp;gt;
                            &amp;lt;span class="btn"&amp;gt;&amp;lt;i class="fa fa-angle-double-right" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;
                        &amp;lt;/a&amp;gt;
                        {% endif %}
                    &amp;lt;/div&amp;gt;
                    {% endif %}
                &amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-11-10 um 10.20.40.png" style="width: 260px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/34081iEA1D672A18A91475/image-dimensions/260x95?v=v2" width="260" height="95" role="button" title="Bildschirmfoto 2020-11-10 um 10.20.40.png" alt="Bildschirmfoto 2020-11-10 um 10.20.40.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone could help me. I'm not that experienced with code besides HTML/CSS.&lt;/P&gt;&lt;P&gt;Br&lt;/P&gt;&lt;P&gt;Lisa&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 09:23:48 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385240#M19495</guid>
      <dc:creator>eyeson</dc:creator>
      <dc:date>2020-11-10T09:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Blog Pagination – show more pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385428#M19503</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/150350"&gt;@eyeson&lt;/a&gt; !&lt;/P&gt;
&lt;P&gt;Welcome to the Community!&lt;/P&gt;
&lt;P&gt;Let me introduce you to smart folks here&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/91608"&gt;@alyssamwilie&lt;/a&gt;, &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/73772"&gt;@Kevin-C&lt;/a&gt; , &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt; , meet &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/150350"&gt;@eyeson&lt;/a&gt;&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;How would any of you go about solving this one?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 18:16:47 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385428#M19503</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2020-11-10T18:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Blog Pagination – show more pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385669#M19519</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/150350"&gt;@eyeson&lt;/a&gt; and thanks &lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/13982"&gt;@dennisedson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll circle back to this friday!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 13:58:31 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385669#M19519</guid>
      <dc:creator>Kevin-C</dc:creator>
      <dc:date>2020-11-11T13:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Blog Pagination – show more pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385862#M19529</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/150350"&gt;@eyeson&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I believe this snippet from the Developer Code Gallery does what you're looking for -&amp;nbsp;&lt;A href="https://designers.hubspot.com/code-gallery/entry/us/dontgojasonwaterfalls-blog-numbered-pagination" target="_blank"&gt;https://designers.hubspot.com/code-gallery/entry/us/dontgojasonwaterfalls-blog-numbered-pagination&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 04:59:07 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385862#M19529</guid>
      <dc:creator>alyssamwilie</dc:creator>
      <dc:date>2020-11-12T04:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Blog Pagination – show more pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385916#M19533</link>
      <description>&lt;P&gt;That looks very promising! Thank you so much, I'll try that right now!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 09:25:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385916#M19533</guid>
      <dc:creator>eyeson</dc:creator>
      <dc:date>2020-11-12T09:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Blog Pagination – show more pages</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385983#M19537</link>
      <description>&lt;P&gt;I had to adapt it a little bit. Here's the solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="pagination wrapper flex-row space-between"&amp;gt;
{% if not simple_list_page %}              

&amp;lt;div class="pages-navigation flex-row align-center"&amp;gt;
    {% set page_list = [-2, -1, 0, 1, 2] %}
    {% if contents.total_page_count - current_page_num == 1 %}{% set offset = -1 %}
    {% elif contents.total_page_count - current_page_num == 0 %}{% set offset = -2 %}
    {% elif current_page_num == 2 %}{% set offset = 1 %}
    {% elif current_page_num == 1 %}{% set offset = 2 %}
    {% else %}{% set offset = 0 %}{% endif %}                      

        {% if current_page_num &amp;gt; 1 %}&amp;lt;a href="{{ blog_page_link(last_page_num) }}"&amp;gt;&amp;lt;span class="btn"&amp;gt;&amp;lt;i class="fa fa-angle-double-left" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;
      &amp;lt;/a&amp;gt;{% endif %}
        {% if contents.total_page_count &amp;gt; 5 %}
            {% if current_page_num &amp;gt;= 4 %}
                &amp;lt;a class="page-number btn" href="{{ blog_page_link(1) }}"&amp;gt;&amp;lt;span&amp;gt;1&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
                &amp;lt;a class="elipses" href="{% if current_page_num &amp;lt;= 5 %}{{ blog_page_link(1) }}{% else %}{{ blog_page_link(current_page_num - 5) }}{% endif %}"&amp;gt;...&amp;lt;/a&amp;gt;
            {% endif %}
        {% endif %}
   
        {% for page in page_list %}
            {% set this_page = current_page_num + page + offset %}
            {% if this_page &amp;gt; 0 and this_page &amp;lt;= contents.total_page_count %}
                &amp;lt;a {% if this_page == current_page_num %} class="page-number btn current"{% else %}class="page-number btn"{% endif %} href="{{ blog_page_link(this_page) }}"&amp;gt;&amp;lt;span&amp;gt;{{ this_page }}&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
            {% endif %}
        {% endfor %}
     
        {% if contents.total_page_count &amp;gt; 5 %}
            {% if contents.total_page_count - current_page_num &amp;gt; 2 %}
                &amp;lt;a class="elipses" href="{% if contents.total_page_count - current_page_num &amp;lt;= 5 %}{{ contents.total_page_count }}{% else %}{{ blog_page_link(current_page_num + 5) }}{% endif %}"&amp;gt;...&amp;lt;/a&amp;gt;
                &amp;lt;a class="page-number btn" href="{{ blog_page_link(contents.total_page_count) }}"&amp;gt;&amp;lt;span&amp;gt;{{ contents.total_page_count }}&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
            {% endif %}
        {% endif %}
        {% if next_page_num %}&amp;lt;a href="{{ blog_page_link(current_page_num + 1) }}"&amp;gt;
      &amp;lt;span class="btn"&amp;gt;&amp;lt;i class="fa fa-angle-double-right" aria-hidden="true"&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/span&amp;gt;
      &amp;lt;/a&amp;gt;{% endif %}
    
&amp;lt;/div&amp;gt;
          {% endif %}
                &amp;lt;/div&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for the input!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 12:59:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Blog-Pagination-show-more-pages/m-p/385983#M19537</guid>
      <dc:creator>eyeson</dc:creator>
      <dc:date>2020-11-12T12:59:49Z</dc:date>
    </item>
  </channel>
</rss>

