I have implemented an if/else statement and when I add the information to the 'else' part it outputs three duplicates of the same content.
I am calling the if statement to check if the user is signed in here more andless. If they are they will get a booking form which shows up fine and only one of them.
{% for user in craft.users.groups('nomad') %}
{% if user.isCurrent %}
<div class="wrapper">
<form method="post" action="" accept-charset="UTF-8">
{{ getCsrfInput() }}
{% for entry in craft.entries.section('studios').search(studio) %}
<input type="hidden" name="fields[studioEmail]" value="{{ entry.email
}}">
{% endfor %}
<input type="hidden" name="action"
value="amForms/submissions/saveSubmission">
<input type="hidden" name="handle" value="bookingForm">
{# Optional: Redirect URL. Will redirect to current page by default. #}
<input type="hidden" name="redirect" value="booking-form/thank-you">
{{ craft.amForms.displayAntispam() }}
<div class="input__wrapper">
<label for="fields-firstName" class="sr-only">First
Name</label>
<input type="text" id="fields-firstName"
name="fields[firstName]" autocomplete="off" placeholder="First Name"
value="{{ currentUser.firstName }}">
</div>
<div class="input__wrapper">
<label for="fields-lastName" class="sr-only">Last Name</label>
<input type="text" id="fields-lastName"
name="fields[lastName]" autocomplete="off" placeholder="Last
Name" value="{{ currentUser.lastName }}">
</div>
<div class="input__wrapper">
<label for="fields-mobileNumber" class="sr-only">Mobile Number</label>
<input type="text" id="fields-mobileNumber" name="fields[mobileNumber]" autocomplete="off" placeholder="Mobile Number" value="{{ currentUser.mobileNumber }}">
</div>
<div class="input__wrapper">
<label for="fields-startDate" class="sr-only">Start
Date</label>
<input type="text" id="fields-startDate"
name="fields[startDate]" autocomplete="off" placeholder="start
Date">
</div>
<div class="input__wrapper">
<label for="fields-endDate" class="sr-only">End Date</label>
<input type="text" id="fields-endDate" name="fields[endDate]"
autocomplete="off" placeholder="End Date">
</div>
<div class="input__wrapper">
<label for="fields-studio" class="sr-only">Studio</label>
<select name="fields[studio]" id="fields-studio">
{% for entry in craft.entries.section('studios').find() %}
<option value="{{ entry.title }}"
{% if studio == entry.title %}
selected="selected"
{% endif %}
>{{ entry.title }}</option>
{% endfor %}
</select>
</div>
<input type="submit" value="Submit">
</form>
</div>
Then this is the else statement. I think I might need to add something to the {% else %}. Though I don't see why it would be outputting three duplicates of the same content in the first place.
{% else %}
<section class="form__wrapper">
<div class="content__form_wrapper sign-up_wrapper">
<h1>Become a Digital Nomad and join the community</h1>
<p>You need to be a member to rent a desk, it will only take a moment of
your and you will be on your way.</p>
<a href="{{ siteUrl }}users/sign-up" class="">Sign Up</a
</div>
</section>
{% endif %}
{% endfor %}
Thanks for the help :)