Answers.Body: <p>I'm not sure how dynamic you need this to be. One way would be to set an order of classes to loop through with <a href="https://twig.symfony.com/doc/2.x/functions/cycle.html" rel="nofollow noreferrer">Tiwg's Cycle function</a>. This would go through each class in the array, in a cycle.</p>
  
  <pre><code>{% set classes = ['full-wide', 'third-wide', 'third-wide', 'third-wide', 'half-wide', 'half-wide'] %}
  
  {% for entry in entries %}
      &lt;div class="{{ cycle(classes, loop.index0) }}"&gt;
          {# output entry #}
      &lt;/div&gt;
  {% endfor %}
  </code></pre>
  
  <p>If you need a bit more flexibility you could use conditionals querying the <a href="https://twig.symfony.com/doc/2.x/tags/for.html#the-loop-variable" rel="nofollow noreferrer">loop variable</a> to determine where you are in the output.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T16:50:24.073Z
Answers.Text: Thank you, I know about cycles, but in my case loops have very different div structure and adding just one class to div is not enough
Answers.UserDisplayName: Artur Potosyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T16:56:20.680Z
Answers.Text: Ok, if you add more specifics to your question I might be able to help. What the HTML need to look like, how variable is the entry data etc. I’m also not sure what you mean by “build categories”.
Answers.UserDisplayName: Simon Kuran
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T20:42:30.613Z
Answers.Text: BTW, I solved my issue thanks to twig slice option
Answers.UserDisplayName: Artur Potosyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-07T20:54:54.777Z
Answers.Text: @ArturPotosyan post it as answer, that way others can use it. :)
Answers.UserDisplayName: Simon Kuran
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-08T11:37:33.230Z
Answers.Text: https://twig.symfony.com/doc/2.x/filters/slice.html
Answers.UserDisplayName: Artur Potosyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-06T23:15:09.793Z
Answers.LastActivityDate: 2019-04-06T23:15:09.793Z
Answers.UserDisplayName: Simon Kuran
Body: <p>Is it possible to build categories with a list of entries that have different styling, like</p>
  
  <pre><code>{% for entry in entries %}
      Row 1 - Entry 1 - full-wide
      Row 2 - 3 entries with (1/3 width of each)
      Row 3 - 2 entries (1/3 and 2/3 width)
      ....
  {% endfor %}
  </code></pre>
  
  <p>Thank you</p>
  
Tags: <templating><entries>
Title: Entries with different styling
ThreadText: # Entries with different styling
  
  (Asked by: username_0 on 2019-04-06)
  
  Is it possible to build categories with a list of entries that have different styling, like
  
  ```
  {% for entry in entries %}
      Row 1 - Entry 1 - full-wide
      Row 2 - 3 entries with (1/3 width of each)
      Row 3 - 2 entries (1/3 and 2/3 width)
      ....
  {% endfor %}
  
  ```
  
  Thank you
  
  **Tags:** templating, entries
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-04-06. Score: 1
  
  I'm not sure how dynamic you need this to be. One way would be to set an order of classes to loop through with [Tiwg's Cycle function](https://twig.symfony.com/doc/2.x/functions/cycle.html). This would go through each class in the array, in a cycle.
  
  ```
  {% set classes = ['full-wide', 'third-wide', 'third-wide', 'third-wide', 'half-wide', 'half-wide'] %}
  
  {% for entry in entries %}
      <div class="{{ cycle(classes, loop.index0) }}">
          {# output entry #}
      </div>
  {% endfor %}
  
  ```
  
  If you need a bit more flexibility you could use conditionals querying the [loop variable](https://twig.symfony.com/doc/2.x/tags/for.html#the-loop-variable) to determine where you are in the output.
  
  > **Comments:**
  > **username_0**: Thank you, I know about cycles, but in my case loops have very different div structure and adding just one class to div is not enough  
  > **username_1**: Ok, if you add more specifics to your question I might be able to help. What the HTML need to look like, how variable is the entry data etc. I’m also not sure what you mean by “build categories”.  
  > **username_0**: BTW, I solved my issue thanks to twig slice option  
  > **username_1**: @username_0 post it as answer, that way others can use it. :)  
  > **username_0**: https://twig.symfony.com/doc/2.x/filters/slice.html  
  
  ---
  
  