Answers.Body: <p>I got it by simply adding a condition where I was displaying my previous entry.</p>
  
  <pre><code>{% if prevEntry %}
  
      {% if prevEntry.comingSoon %}
  
          {# if comingSoon field is active, hide the link #}
  
      {% else %}
  
      &lt;div class="previousProject"&gt;
          &lt;a href="{{ prevEntry.getUrl() }}"&gt;
              &lt;span class="visibleText"&gt;Previous&lt;/span&gt;
              &lt;span class="projectTitle"&gt;{{ prevEntry.client }}&lt;/span&gt;
          &lt;/a&gt;
      &lt;/div&gt;
  
      {% endif %}
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-04T03:21:12.507Z
Answers.LastActivityDate: 2019-06-04T03:21:12.507Z
Answers.UserDisplayName: mateostabio
Body: <p>I have projects on my portfolio that link to each other. I'm currently using previous and next links.</p>
  
  <p>This is what my code looks like</p>
  
  <pre><code>{# Set parameters for prev/next elements list #}
  {% set params = craft.entries.section('portfolio') %}
  {# Get the prev/next elements #}
  {% set prevEntry = entry.getPrev(params) %}
  {% set nextEntry = entry.getNext(params) %}
  </code></pre>
  
  <p>And then I call it to display it in my code like so:</p>
  
  <pre><code>&lt;div class="projectsNavigation"&gt;
      {% if prevEntry %}
      &lt;div class="previousProject"&gt;
          &lt;a href="{{ prevEntry.getUrl() }}"&gt;
              &lt;span class="visibleText"&gt;Previous&lt;/span&gt;
              &lt;span class="projectTitle"&gt;{{ prevEntry.client }}&lt;/span&gt;
          &lt;/a&gt;
      &lt;/div&gt;
      {% endif %}
      {% if nextEntry %}
      &lt;div class="nextProject"&gt;
          &lt;a href="{{ nextEntry.getUrl() }}"&gt;
              &lt;span class="visibleText"&gt;Next Project&lt;/span&gt;
              &lt;span class="projectTitle"&gt;{{ nextEntry.client }}&lt;/span&gt;
          &lt;/a&gt;
      &lt;/div&gt;
      {% endif %}
  &lt;/div&gt;
  </code></pre>
  
  <p>My goal today is to hide the previous entry button if the previous entry has the <code>comingSoon</code> lightswitch field ON. </p>
  
Tags: <entries><lightswitch><previous-next>
Title: Show/display entries next/prev except entries with lightswitch field active
ThreadText: # Show/display entries next/prev except entries with lightswitch field active
  
  (Asked by: username_0 on 2019-06-04)
  
  I have projects on my portfolio that link to each other. I'm currently using previous and next links.
  
  This is what my code looks like
  
  ```
  {# Set parameters for prev/next elements list #}
  {% set params = craft.entries.section('portfolio') %}
  {# Get the prev/next elements #}
  {% set prevEntry = entry.getPrev(params) %}
  {% set nextEntry = entry.getNext(params) %}
  
  ```
  
  And then I call it to display it in my code like so:
  
  ```
  <div class="projectsNavigation">
      {% if prevEntry %}
      <div class="previousProject">
          <a href="{{ prevEntry.getUrl() }}">
              <span class="visibleText">Previous</span>
              <span class="projectTitle">{{ prevEntry.client }}</span>
          </a>
      </div>
      {% endif %}
      {% if nextEntry %}
      <div class="nextProject">
          <a href="{{ nextEntry.getUrl() }}">
              <span class="visibleText">Next Project</span>
              <span class="projectTitle">{{ nextEntry.client }}</span>
          </a>
      </div>
      {% endif %}
  </div>
  
  ```
  
  My goal today is to hide the previous entry button if the previous entry has the `comingSoon` lightswitch field ON.
  
  **Tags:** entries, lightswitch, previous-next
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-06-04. Score: 1
  
  I got it by simply adding a condition where I was displaying my previous entry.
  
  ```
  {% if prevEntry %}
  
      {% if prevEntry.comingSoon %}
  
          {# if comingSoon field is active, hide the link #}
  
      {% else %}
  
      <div class="previousProject">
          <a href="{{ prevEntry.getUrl() }}">
              <span class="visibleText">Previous</span>
              <span class="projectTitle">{{ prevEntry.client }}</span>
          </a>
      </div>
  
      {% endif %}
  {% endif %}
  
  ```
  
  
  ---
  
  