<?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: Create a grid system rendering out all posts but allow one to be customised in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/245420#M10558</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/82586"&gt;@benbagley&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to pull in a few subject matter experts to see if they have any tips for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2450"&gt;@tjoyce&lt;/a&gt;&amp;nbsp;do you have any suggestions for&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/82586"&gt;@benbagley&lt;/a&gt;?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Jenny&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jan 2019 21:13:41 GMT</pubDate>
    <dc:creator>jennysowyrda</dc:creator>
    <dc:date>2019-01-11T21:13:41Z</dc:date>
    <item>
      <title>Create a grid system rendering out all posts but allow one to be customised</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/243929#M10453</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping someone can help me out with a small issue I'm having.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first time using Hubspot and Hubl.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating a blog layout similar to Hubspot's design, and I have almost everything in place, however, when rendering out the blog posts I want to be able to skip a block so I can customise what the text says.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For some context here is what I have so far&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="30dbdd140c606e43b96777c1287bf187" style="width: 833px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/13891i1692057623E00ABC/image-size/large?v=v2&amp;amp;px=999" role="button" title="30dbdd140c606e43b96777c1287bf187" alt="30dbdd140c606e43b96777c1287bf187" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The third smaller box on&amp;nbsp; the left (the box with the black blackground), I or someone else needs to be able to change this to whatever we like,&amp;nbsp; but I still need all posts to be rendering in in correct order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So ideally the layout should be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;post 1&amp;nbsp;&amp;nbsp; | post 2&lt;/P&gt;&lt;P&gt;-----------------------&lt;/P&gt;&lt;P&gt;custom | post 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm unsure how to go about this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently I have the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;section class="posts-grid"&amp;gt;            
{% set rec_posts = blog_recent_posts('default', 6) %}
{% for rec_post in rec_posts %}
  &amp;lt;article class="post {% cycle '','','horizontal-post','long-post','','' %}"&amp;gt;
    {% if rec_post.post_list_summary_featured_image %}
      &amp;lt;img src="{{ rec_post.post_list_summary_featured_image }}" alt="{{ rec_post.featured_image_alt_text }}"&amp;gt;
    {% endif %}
    
    &amp;lt;div class="blog-listing-info"&amp;gt;
      &amp;lt;a href="{{ rec_post.absolute_url }}"&amp;gt;
        &amp;lt;h2 class="blog-listing-title"&amp;gt;
          {{ rec_post.name }}
        &amp;lt;/h2&amp;gt;
      &amp;lt;/a&amp;gt;
      
      &amp;lt;div class="{% cycle 'hidden','hidden','','hidden','hidden','hidden' %}"&amp;gt;
        &amp;lt;a href="{{ rec_post.absolute_url }}" class="btn btn-white read-article-btn"&amp;gt;Read article&amp;lt;/a&amp;gt;
      &amp;lt;/div&amp;gt;
      
      &amp;lt;p class="blog-listing-tag {% cycle '','','hidden','','','' %}"&amp;gt;
        {% if rec_post.topic_list %}
          {% for topic in rec_post.topic_list %}
            &amp;lt;a href="{{ blog_tag_url(group.id, topic.slug) }}" class="topic-name"&amp;gt;{{ topic.name }}.&amp;lt;/a&amp;gt;{% if not loop.last %},{% endif %}
          {% endfor %}
        {% endif %}
        -
        {% set initialPostWords = rec_post.post_body|wordcount %}
        {% set calculatedPostWords = (initialPostWords/100) * 100 %}
        {% set finishedPostWords = calculatedPostWords|divide(300)|round(2) %}
        {% set number = finishedPostWords|round %}
        {% if number &amp;lt; 1 %}
        {% else %}
         {{ finishedPostWords|round }} minute read
        {% endif %}
      &amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  &amp;lt;/article&amp;gt;
{% endfor %}
&amp;lt;/section&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;horizontal-post&lt;/STRONG&gt; being the blue box that I want to be able to customise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 19:24:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/243929#M10453</guid>
      <dc:creator>benbagley</dc:creator>
      <dc:date>2019-01-02T19:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create a grid system rendering out all posts but allow one to be customised</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/245420#M10558</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/82586"&gt;@benbagley&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to pull in a few subject matter experts to see if they have any tips for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/61659"&gt;@Stephanie-OG&lt;/a&gt;,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2450"&gt;@tjoyce&lt;/a&gt;&amp;nbsp;do you have any suggestions for&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/82586"&gt;@benbagley&lt;/a&gt;?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Jenny&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jan 2019 21:13:41 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/245420#M10558</guid>
      <dc:creator>jennysowyrda</dc:creator>
      <dc:date>2019-01-11T21:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create a grid system rendering out all posts but allow one to be customised</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/245772#M10600</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/3685"&gt;@jennysowyrda&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Ben,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would probably use &lt;A href="https://designers.hubspot.com/docs/hubl/for-loops" target="_self"&gt;loop.index&lt;/A&gt; to break into the loop and do something differently with your third post, so you could have something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;section class="posts-grid"&amp;gt;            
{% set rec_posts = blog_recent_posts('default', 6) %}
{% for rec_post in rec_posts %}
&lt;FONT color="#FF6600"&gt;  {% if loop.index == 3 %}
     &amp;lt;article&amp;gt;Your custom article&amp;lt;/article&amp;gt;
     &amp;lt;article class="post {% cycle '','','horizontal-post','long-post','','' %}"&amp;gt;
       ...
     &amp;lt;/article&amp;gt;
  {% else %}&lt;/FONT&gt;
     &amp;lt;article class="post {% cycle '','','horizontal-post','long-post','','' %}"&amp;gt;
       ...
     &amp;lt;/article&amp;gt;
&lt;FONT color="#FF6600"&gt;   {% endif %}&lt;/FONT&gt;
{% endfor %}
&amp;lt;/section&amp;gt;&lt;/PRE&gt;&lt;P&gt;I hope that helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;&lt;IMG src="https://cdn2.hubspot.net/hubfs/1951013/Logos/stephanieogaygarcialogo_black.png" border="0" alt="Stephanie O'Gay Garcia" width="300" /&gt;&lt;/A&gt;HubSpot Design / Development&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank"&gt;Contact&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#32C43F"&gt;&lt;I&gt;If this helped, please mark it as the solution to your question, thanks!&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 01:03:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/245772#M10600</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2019-01-15T01:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create a grid system rendering out all posts but allow one to be customised</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/251018#M10881</link>
      <description>&lt;P&gt;So this works, but I still need to skip the first post in the list as well.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 12:30:51 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/251018#M10881</guid>
      <dc:creator>benbagley</dc:creator>
      <dc:date>2019-02-06T12:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create a grid system rendering out all posts but allow one to be customised</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/251029#M10883</link>
      <description>&lt;P&gt;Hi Ben,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Skipping the first post in the list follows the same logic of using the loop.index and a conditional:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{% if loop.index &amp;gt; 1 %}&lt;/PRE&gt;&lt;P&gt;You could have something like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;section class="posts-grid"&amp;gt;            
{% set rec_posts = blog_recent_posts('default', 6) %}
{% for rec_post in rec_posts %}
&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt; {% if loop.index &amp;gt; 1 %}&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#FF9900"&gt;  &lt;BR /&gt;   {% if loop.index == 3 %}
     &amp;lt;article&amp;gt;Your custom article&amp;lt;/article&amp;gt;
     &amp;lt;article class="post {% cycle '','','horizontal-post','long-post','','' %}"&amp;gt;
       ...
     &amp;lt;/article&amp;gt;
  {% else %}&lt;/FONT&gt;
     &amp;lt;article class="post {% cycle '','','horizontal-post','long-post','','' %}"&amp;gt;
       ...
     &amp;lt;/article&amp;gt;
&lt;FONT color="#FF9900"&gt;   {% endif %}&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#FF6600"&gt; &lt;BR /&gt; {% endif %}&lt;BR /&gt;&lt;/FONT&gt;&lt;/STRONG&gt;{% endfor %}
&amp;lt;/section&amp;gt;&lt;/PRE&gt;&lt;P&gt;There might be another solution without nesting loops, perhaps switching the &lt;FONT face="courier new,courier"&gt;{% else %}&lt;/FONT&gt; to an &lt;FONT face="courier new,courier"&gt;{% elif loop.index &amp;gt; 1 %}&lt;/FONT&gt;? If I'm not mistaken (I haven't tested this), the nested loops option starts from the second post and so the "third" is the fourth post originally whereas in this case the third is actually the third and the remainder start from the second post.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Stephanie O'Gay Garcia&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;HubSpot Design / Development&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank" rel="noopener"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank" rel="noopener"&gt;Contact&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#32C43F"&gt;&lt;I&gt;If this helped, please mark it as the solution to your question, thanks!&lt;/I&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 13:13:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/251029#M10883</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2019-02-06T13:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Create a grid system rendering out all posts but allow one to be customised</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/251047#M10889</link>
      <description>&lt;P&gt;Yeah I figured it out, had to have two loops.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 13:55:43 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/251047#M10889</guid>
      <dc:creator>benbagley</dc:creator>
      <dc:date>2019-02-06T13:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Create a grid system rendering out all posts but allow one to be customised</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/251350#M10903</link>
      <description>&lt;P&gt;Hi&amp;nbsp; Ben - I realised that I should also point out that when you're doing the&amp;nbsp;&lt;FONT face="courier new,courier"&gt;{% if loop.index == 3 %}&amp;nbsp;&lt;/FONT&gt;it's replacing that third post with what's in there, so you'll want to add the code for the different element as well as for the third post so that it's not skipped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that makes sense!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;FONT size="5"&gt;&lt;STRONG&gt;Stephanie O'Gay Garcia&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;HubSpot Design / Development&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.stephanieogaygarcia.com?utm_source=HubSpotCommunity" target="_blank"&gt;Website&lt;/A&gt; | &lt;A href="http://www.stephanieogaygarcia.com/contact?utm_source=HubSpotCommunity" target="_blank"&gt;Contact&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 15:23:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Create-a-grid-system-rendering-out-all-posts-but-allow-one-to-be/m-p/251350#M10903</guid>
      <dc:creator>Stephanie-OG</dc:creator>
      <dc:date>2019-02-07T15:23:16Z</dc:date>
    </item>
  </channel>
</rss>

