<?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: Define how many columns will be inside a Custom Module in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196854#M6789</link>
    <description>&lt;P&gt;This is actually really simple in the new Design Manager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a custom Module with 4 fields..&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;A Text Module (This will be the title)&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;A Rich tect module for the paragraph.&lt;/LI&gt;&lt;LI&gt;Create group that contains:&amp;nbsp;Image Module and Text Module and make that repeatable.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Then you will use flex-box to align the icons in a row. No Mater how many there are.&lt;/P&gt;&lt;PRE&gt;&amp;lt;div class="wrapper"&amp;gt;
    &amp;lt;h2&amp;gt;Title&amp;lt;/h2&amp;gt;
    &amp;lt;div class="paragraph"&amp;gt;Paragraph text here&amp;lt;/div&amp;gt;
   &amp;lt;div class="flex-box-wrapper"&amp;gt;

       &amp;lt;div class="flex-item"&amp;gt;Image and text in here&amp;lt;/div&amp;gt;
       &amp;lt;div class="flex-item"&amp;gt;Image and text in here&amp;lt;/div&amp;gt;
       &amp;lt;div class="flex-item"&amp;gt;Image and text in here&amp;lt;/div&amp;gt;
       &amp;lt;div class="flex-item"&amp;gt;Image and text in here&amp;lt;/div&amp;gt;

    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;style&amp;gt;
    .flex-box-wrapper {
        display: flex;
        flex-flow: row wrap;
        justify-content: center;
    }
    .flex-item {
        flex: 1;
        max-width: 20%;
        padding: 1rem;
    }

&amp;lt;/style&amp;gt;&lt;/PRE&gt;&lt;P&gt;After that you need to make the responsive bits so it breaks well on mobile and such.. Perferably mobile first if you can.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jul 2018 15:50:56 GMT</pubDate>
    <dc:creator>ChadP</dc:creator>
    <dc:date>2018-07-10T15:50:56Z</dc:date>
    <item>
      <title>Define how many columns will be inside a Custom Module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196851#M6788</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I learned how to create custom modules and how to use them. Now I'm facing a problem to customise it more.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have these variations&amp;nbsp;bellow,&amp;nbsp;with&amp;nbsp;5 and 4 items, and maybe in a future, 3 items in a row.&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="Screen Shot 2018-07-10 at 17.28.06.png" style="width: 567px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/10384i60FB836A2E4E8334/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-07-10 at 17.28.06.png" alt="Screen Shot 2018-07-10 at 17.28.06.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-07-10 at 17.28.02.png" style="width: 597px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/10385i8BBEBE4078354F12/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-07-10 at 17.28.02.png" alt="Screen Shot 2018-07-10 at 17.28.02.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;I'm trying to think how would be better to develop this, and so far I have this idea:&lt;BR /&gt;&lt;BR /&gt;Create a Main Custom Module&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;A text field for the title&lt;/LI&gt;&lt;LI&gt;A rich text field for the description&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For the items, I was thinking to create another custom module for it and add it to the Main Custom Module, is this possible?&lt;BR /&gt;&lt;BR /&gt;If yes, where can I manage how many columns each item&amp;nbsp;should&amp;nbsp;have?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 15:33:35 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196851#M6788</guid>
      <dc:creator>italoborges</dc:creator>
      <dc:date>2018-07-10T15:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Define how many columns will be inside a Custom Module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196854#M6789</link>
      <description>&lt;P&gt;This is actually really simple in the new Design Manager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a custom Module with 4 fields..&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;A Text Module (This will be the title)&lt;/LI&gt;&lt;LI&gt;&amp;nbsp;A Rich tect module for the paragraph.&lt;/LI&gt;&lt;LI&gt;Create group that contains:&amp;nbsp;Image Module and Text Module and make that repeatable.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Then you will use flex-box to align the icons in a row. No Mater how many there are.&lt;/P&gt;&lt;PRE&gt;&amp;lt;div class="wrapper"&amp;gt;
    &amp;lt;h2&amp;gt;Title&amp;lt;/h2&amp;gt;
    &amp;lt;div class="paragraph"&amp;gt;Paragraph text here&amp;lt;/div&amp;gt;
   &amp;lt;div class="flex-box-wrapper"&amp;gt;

       &amp;lt;div class="flex-item"&amp;gt;Image and text in here&amp;lt;/div&amp;gt;
       &amp;lt;div class="flex-item"&amp;gt;Image and text in here&amp;lt;/div&amp;gt;
       &amp;lt;div class="flex-item"&amp;gt;Image and text in here&amp;lt;/div&amp;gt;
       &amp;lt;div class="flex-item"&amp;gt;Image and text in here&amp;lt;/div&amp;gt;

    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;style&amp;gt;
    .flex-box-wrapper {
        display: flex;
        flex-flow: row wrap;
        justify-content: center;
    }
    .flex-item {
        flex: 1;
        max-width: 20%;
        padding: 1rem;
    }

&amp;lt;/style&amp;gt;&lt;/PRE&gt;&lt;P&gt;After that you need to make the responsive bits so it breaks well on mobile and such.. Perferably mobile first if you can.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2018 15:50:56 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196854#M6789</guid>
      <dc:creator>ChadP</dc:creator>
      <dc:date>2018-07-10T15:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Define how many columns will be inside a Custom Module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196897#M6795</link>
      <description>&lt;P&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/62782"&gt;@italoborges&lt;/a&gt;,&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/2019"&gt;@ChadP&lt;/a&gt;'s answer is pretty much what I would go with but I would like to add to it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Flexbox isn't natively supported by most browsers so you have to use prefixes on flexbox css attributes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You definetely want to create the necessary field, I believe an image and text module in your case, and you want to group them and make that group repeatable like&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/2019"&gt;@ChadP&lt;/a&gt;&amp;nbsp;has suggested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wouldn't set a max-width on the flexed items though. At best it will cause the items to align the the left side of the page. If the max-width is 20% then you would need 5 items to fill the page, any less and the missing items space would be empty on the right side. That is provided that width controls work on flexed items and I do not believe that it does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is some blanket prefixes:&lt;/P&gt;
&lt;PRE&gt;parent {
    display: flex;
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: -o-flex;

    flex-direction: row;
    -webkit-flex-drection: row;
    -moz-flex-direction: row;
    -ms-flex-direction: row;
    -o-flex-direction: row;
}

child {
    flex: 1;&lt;BR /&gt;    -webkit-flex: 1;&lt;BR /&gt;    -moz-flex: 1;&lt;BR /&gt;    -ms-flex: 1;&lt;BR /&gt;    -o-flex: 1;
}&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;as far as adjusting parent width to account for different numbers of children, you can use some forloop magic:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;div class="parent child_{% children.length %}"&amp;gt;
    {% for items in children %}
        &amp;lt;div class="child"&amp;gt;&amp;lt;/div&amp;gt;
    {% endfor %}
&amp;lt;/div&amp;gt;

&amp;lt;style&amp;gt;
    .parent {
        width: 100%;
        margin: 0 auto;
    }

    .parent.child_1 {
        width: 20%;
        margin: 0 auto;
    }

    .parent.child_2 {
        width: 40%;
        margin: 0 auto;
    }

    .parent.child_3 {
        width: 60%;
        margin: 0 auto;
    }
&amp;lt;/style&amp;gt;&lt;/PRE&gt;
&lt;P&gt;I added a class to the parent element starting with 'child_' and appended the number of items in the item collection "children" to it so the class will change with the number of items, i.e. "child_1", child_2" etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can change the width of the parent based on the number of items and set the parent to left and right margins "auto" to center it.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can learn more about flexbox here:&amp;nbsp;&lt;A href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" target="_blank" rel="noopener"&gt;https://css-tricks.com/snippets/css/a-guide-to-flexbox/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need help? &lt;A href="https://www.upwork.com/o/companies/_~0124e15ff34efb3871/" target="_blank" rel="noopener"&gt;Hire Us Here&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 10:15:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196897#M6795</guid>
      <dc:creator>Jsum</dc:creator>
      <dc:date>2019-05-31T10:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Define how many columns will be inside a Custom Module</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196990#M6805</link>
      <description>&lt;P&gt;Thank you all! It worked like a charm!&lt;BR /&gt;&lt;BR /&gt;I used both answers to build my solution!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:51:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Define-how-many-columns-will-be-inside-a-Custom-Module/m-p/196990#M6805</guid>
      <dc:creator>italoborges</dc:creator>
      <dc:date>2018-07-11T13:51:37Z</dc:date>
    </item>
  </channel>
</rss>

