Answers.Body: <p>There's a special <a href="http://twig.sensiolabs.org/doc/tags/for.html#the-loop-variable" rel="nofollow"><code>loop</code></a> variable available in for loops which provides info about the iteration.
  In your case you'd just insert that list item after the 2nd iteration:</p>
  
  <pre><code>{% for entry in entriesOnPage %}
      &lt;li class="class-A"&gt;{{ entry.title }}&lt;/li&gt;
  
      {% if loop.index == 2 %}
          &lt;li class="class-B"&gt;I'm am different&lt;/li&gt;
      {% endif %}
  {% endfor %}
  </code></pre>
  
  <p>If you want to do this only on select pagination pages, you'd additionally compare  against the <a href="http://buildwithcraft.com/docs/templating/paginate#the-paginate-variable" rel="nofollow"><code>paginate</code></a> variable available in between <code>paginate</code> tags:</p>
  
  <pre><code>{% if loop.index == 2 and paginate.currentPage == 12 %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-14T17:27:47.693Z
Answers.Text: This was perfect! Thanks for the quick and easy answer.
Answers.UserDisplayName: Ricardo Henriquez
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-14T16:44:35.520Z
Answers.LastActivityDate: 2015-05-14T17:09:02.900Z
Answers.LastEditDate: 2015-05-14T17:09:02.900Z
Answers.UserDisplayName: carlcs
Answers.Body: <p>You could add a new entry type to your "example" section with a single field of type entries field and use that to "pull in" your special entry into your section.</p>
  
  <p>Within your entries loop you can check for the entry's entry type to switch classes:</p>
  
  <pre><code>{% set class = entry.type == 'special' ? 'class-B' : 'class-A' %}
  </code></pre>
  
  <p>or to include different template partials:</p>
  
  <pre><code>{% include '_partials/example_index/' ~ entry.type %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-14T16:55:32.407Z
Answers.LastActivityDate: 2015-05-14T17:07:05.397Z
Answers.LastEditDate: 2015-05-14T17:07:05.397Z
Answers.UserDisplayName: carlcs
Body: <p>I want to apologize if I'm not asking the question correctly, but basically this is what I want to do:</p>
  
  <p>I have this craft.entries:</p>
  
  <pre><code>{% paginate craft.entries.section('example').limit(10) as entriesOnPage %}
    {% for entry in entriesOnPage %}
      &lt;li class="class-A"&gt;{{ entry.title }}&lt;/li&gt;
    {% endfor %}
  {% endpaginate %}
  </code></pre>
  
  <p>How do I insert another list-item with a different class that has to always stay in same position. For this example in the 3rd spot, to look something like this:</p>
  
  <pre><code>&lt;li class="class-A"&gt;I'm a title&lt;/li&gt;
  &lt;li class="class-A"&gt;I'm a title&lt;/li&gt;
  &lt;li class="class-B"&gt;I'm am different&lt;/li&gt;
  &lt;li class="class-A"&gt;I'm a title&lt;/li&gt;
  ....
  </code></pre>
  
  <p>Once again, I apologize if I'm not using the right terms, but hopefully the code can explain it. </p>
  
  <p>Thanks!</p>
  
Tags: <templating><entries><sorting><custom>
Title: How do I insert a special entry into a sections list?
ThreadText: # How do I insert a special entry into a sections list?
  
  (Asked by: username_0 on 2015-05-14)
  
  I want to apologize if I'm not asking the question correctly, but basically this is what I want to do:
  
  I have this craft.entries:
  
  ```
  {% paginate craft.entries.section('example').limit(10) as entriesOnPage %}
    {% for entry in entriesOnPage %}
      <li class="class-A">{{ entry.title }}</li>
    {% endfor %}
  {% endpaginate %}
  
  ```
  
  How do I insert another list-item with a different class that has to always stay in same position. For this example in the 3rd spot, to look something like this:
  
  ```
  <li class="class-A">I'm a title</li>
  <li class="class-A">I'm a title</li>
  <li class="class-B">I'm am different</li>
  <li class="class-A">I'm a title</li>
  ....
  
  ```
  
  Once again, I apologize if I'm not using the right terms, but hopefully the code can explain it.
  
  Thanks!
  
  **Tags:** templating, entries, sorting, custom
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-05-14. Score: 3 | Accepted answer
  
  There's a special [`loop`](http://twig.sensiolabs.org/doc/tags/for.html#the-loop-variable) variable available in for loops which provides info about the iteration.
  In your case you'd just insert that list item after the 2nd iteration:
  
  ```
  {% for entry in entriesOnPage %}
      <li class="class-A">{{ entry.title }}</li>
  
      {% if loop.index == 2 %}
          <li class="class-B">I'm am different</li>
      {% endif %}
  {% endfor %}
  
  ```
  
  If you want to do this only on select pagination pages, you'd additionally compare against the [`paginate`](http://buildwithcraft.com/docs/templating/paginate#the-paginate-variable) variable available in between `paginate` tags:
  
  ```
  {% if loop.index == 2 and paginate.currentPage == 12 %}
  
  ```
  
  > **Comments:**
  > **username_0**: This was perfect! Thanks for the quick and easy answer.  
  
  ---
  
  ### Answer by username_1 on 2015-05-14. Score: 1
  
  You could add a new entry type to your "example" section with a single field of type entries field and use that to "pull in" your special entry into your section.
  
  Within your entries loop you can check for the entry's entry type to switch classes:
  
  ```
  {% set class = entry.type == 'special' ? 'class-B' : 'class-A' %}
  
  ```
  
  or to include different template partials:
  
  ```
  {% include '_partials/example_index/' ~ entry.type %}
  
  ```
  
  
  ---
  
  