Answers.Body: <p>I was missing: <code>{% set category = entry.workCategory%}</code></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-23T08:57:52.427Z
Answers.LastActivityDate: 2016-12-23T18:24:49.683Z
Answers.LastEditDate: 2016-12-23T18:24:49.683Z
Answers.UserDisplayName: user2569
Answers.Body: <p>When you are within your <code>nav</code> tag context, <code>category</code> definitely exists, even if you're using <code>include</code> for the first snippet you posted. If you're talking about the automatically pre-assigned variable for a single category's page, make sure the category group settings are still correct and that you are requesting the right URLs.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-23T08:10:38.663Z
Answers.LastActivityDate: 2016-12-23T08:10:38.663Z
Answers.UserDisplayName: carlcs
Body: <p>I'm not sure what I've done, I had this working at the top of my entry.html template:</p>
  
  <hr>
  
  <pre><code>{% set params = craft.entries.section('ourWork').relatedTo(category) %}
  
  {% set prevEntry = entry.getPrev(params) %}
  {% set nextEntry = entry.getNext(params) %}
  
  {% if prevEntry %}&lt;a href="{{ prevEntry.url }}"&gt;Previous&lt;/a&gt;{% endif %}
  {% if nextEntry %}&lt;a href="{{ nextEntry.url }}"&gt;Next&lt;/a&gt;{% endif %}
  </code></pre>
  
  <p>For some reason I just get:
  Variable "category" does not exist</p>
  
  <p>The section name is correct and this does have a category field assigned.</p>
  
  <p>my index template category part is:</p>
  
  <pre><code>{# Projects
  ---------------------------------------------------------------------------#}
  &lt;div class="banner projects"&gt;
  &lt;div class="row"&gt;        
    &lt;ul class="no-bullet small-up-2 medium-up-3 large-up-4 large-centered"&gt; 
    {#
    Display catgeory nav 'ourWork'
    #}
      {% nav category in craft.categories.group('ourWork').level(1) %}         
        &lt;li class= "column"&gt;                        
            {# &lt;p&gt;{{ category.WorkCategoryDescription }}&lt;p&gt; #}                 
            &lt;a href="{{ category.url }}"&gt;&lt;img src="{{ category.categoryImageThumb.first.getUrl('categoryThumbnail') }}"&gt;&lt;/a&gt;             
            &lt;p&gt; &lt;a href="{{ category.url }}"&gt;{{ category.title }} &lt;/a&gt;&lt;p&gt;
        &lt;/li&gt;
      {% endnav %}
    &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-23T08:11:05.670Z
Comments.Text: Can you explain how you use these two snippets of code together?
Comments.UserDisplayName: carlcs
Tags: <category>
Title: Previous and next entries nav – within a categeory
ThreadText: # Previous and next entries nav – within a categeory
  
  (Asked by: username_0 on 2016-12-22)
  
  I'm not sure what I've done, I had this working at the top of my entry.html template:
  
  ---
  
  ```
  {% set params = craft.entries.section('ourWork').relatedTo(category) %}
  
  {% set prevEntry = entry.getPrev(params) %}
  {% set nextEntry = entry.getNext(params) %}
  
  {% if prevEntry %}<a href="{{ prevEntry.url }}">Previous</a>{% endif %}
  {% if nextEntry %}<a href="{{ nextEntry.url }}">Next</a>{% endif %}
  
  ```
  
  For some reason I just get:
  Variable "category" does not exist
  
  The section name is correct and this does have a category field assigned.
  
  my index template category part is:
  
  ```
  {# Projects
  ---------------------------------------------------------------------------#}
  <div class="banner projects">
  <div class="row">        
    <ul class="no-bullet small-up-2 medium-up-3 large-up-4 large-centered"> 
    {#
    Display catgeory nav 'ourWork'
    #}
      {% nav category in craft.categories.group('ourWork').level(1) %}         
        <li class= "column">                        
            {# <p>{{ category.WorkCategoryDescription }}<p> #}                 
            <a href="{{ category.url }}"><img src="{{ category.categoryImageThumb.first.getUrl('categoryThumbnail') }}"></a>             
            <p> <a href="{{ category.url }}">{{ category.title }} </a><p>
        </li>
      {% endnav %}
    </ul>
  </div>
  
  ```
  
  **Tags:** category
  
  > **Comments:**
  > **username_1**: Can you explain how you use these two snippets of code together?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2016-12-23. Score: 1
  
  I was missing: `{% set category = entry.workCategory%}`
  
  
  ---
  
  ### Answer by username_1 on 2016-12-23. Score: 1
  
  When you are within your `nav` tag context, `category` definitely exists, even if you're using `include` for the first snippet you posted. If you're talking about the automatically pre-assigned variable for a single category's page, make sure the category group settings are still correct and that you are requesting the right URLs.
  
  
  ---
  
  