<?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: Get the even rows of a repeater using loop.index in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618750#M28384</link>
    <description>&lt;P&gt;&lt;SPAN&gt;hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/371276"&gt;@jrstaton&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Instead of using loop.index it will be much better to use class or id by {{name}}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Like &amp;lt;div class="{{ name }}"&amp;gt; give this class in top of your repeater module and close div after repeater module and give your css like as shown in below image , you can define all your css like this then you can get ability to control each card module , no matter how many times you are using same module&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChehakWadhdwa_0-1650442786284.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/64490iC88F06CCF9B7F50E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChehakWadhdwa_0-1650442786284.png" alt="ChehakWadhdwa_0-1650442786284.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;If we were able to answer your query, kindly help the community by marking it as a solution.&lt;BR /&gt;Thanks and Regards.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2022 08:20:20 GMT</pubDate>
    <dc:creator>ChehakWadhdwa</dc:creator>
    <dc:date>2022-04-20T08:20:20Z</dc:date>
    <item>
      <title>Get the even rows of a repeater using loop.index</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618469#M28378</link>
      <description>&lt;P&gt;Trying to figure out how to get the even rows in a repeater. I've seen loop.index used to target specific rows but not for all the even or odd rows. Any help is appreciated. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 22:16:19 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618469#M28378</guid>
      <dc:creator>jrstaton</dc:creator>
      <dc:date>2022-04-19T22:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Get the even rows of a repeater using loop.index</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618750#M28384</link>
      <description>&lt;P&gt;&lt;SPAN&gt;hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/371276"&gt;@jrstaton&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Instead of using loop.index it will be much better to use class or id by {{name}}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Like &amp;lt;div class="{{ name }}"&amp;gt; give this class in top of your repeater module and close div after repeater module and give your css like as shown in below image , you can define all your css like this then you can get ability to control each card module , no matter how many times you are using same module&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ChehakWadhdwa_0-1650442786284.png" style="width: 400px;"&gt;&lt;img src="https://community.hubspot.com/t5/image/serverpage/image-id/64490iC88F06CCF9B7F50E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ChehakWadhdwa_0-1650442786284.png" alt="ChehakWadhdwa_0-1650442786284.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!&lt;/P&gt;
&lt;P&gt;If we were able to answer your query, kindly help the community by marking it as a solution.&lt;BR /&gt;Thanks and Regards.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 08:20:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618750#M28384</guid>
      <dc:creator>ChehakWadhdwa</dc:creator>
      <dc:date>2022-04-20T08:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get the even rows of a repeater using loop.index</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618889#M28389</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/345416"&gt;@ChehakWadhdwa&lt;/a&gt;&amp;nbsp;- I think I should provide more information as I'm not understanding how your suggestion will accomplish what I'm trying to create.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a vertical animated timeline that reveals itself on page scroll. I want the repeater fields to alternate its starting animation either from the left or from the right. So what I need is for all the odd repeater fields to have the class "js--fadeInLeft" and all the even repeater fields to have the class "js--fadeInRight". Below is the code I'm using for reference:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    {% for item in module.timeline_item %}
      &amp;lt;div class="timeline-item"&amp;gt;
        &amp;lt;div class="timeline-content {% if loop.index == '2' %}js--fadeInRight{% else %}js--fadeInLeft{% endif %}"&amp;gt;
          &amp;lt;h5&amp;gt;{% inline_text field="timeline_title" value="{{ item.timeline_title }}" %}&amp;lt;/h5&amp;gt;
          {% inline_rich_text field="timeline_content" value="{{ item.timeline_content }}" %}
        &amp;lt;/div&amp;gt;
      &amp;lt;/div&amp;gt;
    {% endfor %}&lt;/LI-CODE&gt;&lt;P&gt;This module is for a client so I need to have them only editing the content of the repeater and not class names and stylesheets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 13:13:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618889#M28389</guid>
      <dc:creator>jrstaton</dc:creator>
      <dc:date>2022-04-20T13:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get the even rows of a repeater using loop.index</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618939#M28390</link>
      <description>&lt;P&gt;Got what I needed from the dev slack channel. For anyone that comes across this looking for the same thing, here's the code needed and a link to the docs -&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/cms/hubl/operators-and-expression-tests#even" target="_blank" rel="noopener"&gt;https://developers.hubspot.com/docs/cms/hubl/operators-and-expression-tests#even&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="jinja2"&gt;{% if loop.index is even %}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 14:23:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618939#M28390</guid>
      <dc:creator>jrstaton</dc:creator>
      <dc:date>2022-04-20T14:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Get the even rows of a repeater using loop.index</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618960#M28392</link>
      <description>&lt;P&gt;Thanks for adding the solution here.&lt;/P&gt;
&lt;P&gt;Sometimes, the answer is so darn simple you almost smack yourself in the head when you see it!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 14:52:12 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Get-the-even-rows-of-a-repeater-using-loop-index/m-p/618960#M28392</guid>
      <dc:creator>dennisedson</dc:creator>
      <dc:date>2022-04-20T14:52:12Z</dc:date>
    </item>
  </channel>
</rss>

