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.