Show/display entries next/prev except entries with lightswitch field active 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:

&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;


My goal today is to hide the previous entry button if the previous entry has the comingSoon lightswitch field ON.
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 %}

    &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 %}