Answers.Body: <p>I don't know if this is the best solution or if it will even work, but this would be my first try.</p>
  
  <pre><code>{% for spotlight in craft.entries().section('spotlights').all() %}
    {# Check to see if the title of the "spotlight" matches the current entry's title #}
    {% if spotlight.title == entry.title %}
      &lt;div class="entry-count"&gt;{{ loop.index }} of {{ total }}&lt;/div&gt;
    {% endif %}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-29T17:32:03.280Z
Answers.LastActivityDate: 2020-04-29T17:32:03.280Z
Answers.UserDisplayName: Jon Weedin
Body: <p>I have a channel which has multiple entries in, I'm trying to output the current entry number, for example "<strong>1</strong> out of 20 posts"</p>
  
  <p>Currently this is what I am working with:</p>
  
  <pre><code>{% set total = craft.entries().section('spotlights').count() %}
  {% set params = {section: 'spotlights', order: 'postDate desc', limit: null} %}
  {% set entry_prev = entry.getPrev(params) %}
  {% set entry_next = entry.getNext(params) %}
  
  &lt;section class="page-nav-wrapper"&gt;
    &lt;div class="container"&gt;
      &lt;div class="page-nav"&gt;
        {% if entry_prev %}
        &lt;div class="previous-page"&gt;
          &lt;a href="{{entry_prev.url}}"&gt;Previous&lt;/a&gt;
        &lt;/div&gt;
        {% else %}
        &lt;div class="previous-page"&gt;
          &lt;a class="disabled"&gt;Previous&lt;/a&gt;
        &lt;/div&gt;
        {% endif %}
        &lt;div class="entry-count"&gt;ENTRY NUMBER HERE of {{ total }}&lt;/div&gt;
        {% if entry_next %}
        &lt;div class="next-page"&gt;
          &lt;a href="{{entry_next.url}}"&gt;Next&lt;/a&gt;
        &lt;/div&gt;
        {% else %}
        &lt;div class="next-page"&gt;
          &lt;a class="disabled"&gt;Next&lt;/a&gt;
        &lt;/div&gt;
        {% endif %}
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/section&gt;
  </code></pre>
  
  <p>I have my next and previous links working as well as the total entries in the section, I just can't work out how to get the current entry in the section. Any help would be appreciated.</p>
  
  <p>I have tried a few different solutions on here but they all seem to be outdated.</p>
  
  <p>Thanks.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-04-26T10:41:09.047Z
Comments.Text: Have you tried this here? https://craftcms.stackexchange.com/questions/5125/get-entry-index
Comments.UserDisplayName: Max Strebel
Tags: <entries><pagination><count>
Title: Struggling to get Entry index number so I can output "X of Total Entries"
ThreadText: # Struggling to get Entry index number so I can output "X of Total Entries"
  
  (Asked by: username_0 on 2020-04-25)
  
  I have a channel which has multiple entries in, I'm trying to output the current entry number, for example "**1** out of 20 posts"
  
  Currently this is what I am working with:
  
  ```
  {% set total = craft.entries().section('spotlights').count() %}
  {% set params = {section: 'spotlights', order: 'postDate desc', limit: null} %}
  {% set entry_prev = entry.getPrev(params) %}
  {% set entry_next = entry.getNext(params) %}
  
  <section class="page-nav-wrapper">
    <div class="container">
      <div class="page-nav">
        {% if entry_prev %}
        <div class="previous-page">
          <a href="{{entry_prev.url}}">Previous</a>
        </div>
        {% else %}
        <div class="previous-page">
          <a class="disabled">Previous</a>
        </div>
        {% endif %}
        <div class="entry-count">ENTRY NUMBER HERE of {{ total }}</div>
        {% if entry_next %}
        <div class="next-page">
          <a href="{{entry_next.url}}">Next</a>
        </div>
        {% else %}
        <div class="next-page">
          <a class="disabled">Next</a>
        </div>
        {% endif %}
      </div>
    </div>
  </section>
  
  ```
  
  I have my next and previous links working as well as the total entries in the section, I just can't work out how to get the current entry in the section. Any help would be appreciated.
  
  I have tried a few different solutions on here but they all seem to be outdated.
  
  Thanks.
  
  **Tags:** entries, pagination, count
  
  > **Comments:**
  > **username_1**: Have you tried this here? https://craftcms.stackexchange.com/questions/5125/get-entry-index  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-04-29. Score: 1
  
  I don't know if this is the best solution or if it will even work, but this would be my first try.
  
  ```
  {% for spotlight in craft.entries().section('spotlights').all() %}
    {# Check to see if the title of the "spotlight" matches the current entry's title #}
    {% if spotlight.title == entry.title %}
      <div class="entry-count">{{ loop.index }} of {{ total }}</div>
    {% endif %}
  {% endfor %}
  
  ```
  
  
  ---
  
  