Last active
September 29, 2021 14:12
-
-
Save ademers/f207b3a62423f62142568e53a941275b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# NOTE: Required so that judges don't override other judges' matrix blocks! #} | |
<!-- Matrix blocks exist --> | |
{% if entry.judgeSelections|length %} | |
{% for block in entry.judgeSelections.all() %} | |
<input type="hidden" | |
name="fields[judgeSelections][{{ block.id }}][type]" | |
value="judgeSelection" | |
> | |
<input type="hidden" | |
name="fields[judgeSelections][{{ block.id }}][enabled]" | |
value="1" | |
> | |
{% endfor %} | |
{# If not Matrix blocks, add new one for current user #} | |
{% else %} | |
<input type="hidden" | |
name="fields[judgeSelections][new1][type]" | |
value="judgeSelection" | |
> | |
<input type="hidden" | |
name="fields[judgeSelections][new1][enabled]" | |
value="1" | |
> | |
<input type="hidden" | |
name="fields[judgeSelections][new1][fields][member][user.id]" | |
value="{{ currentUser.id }}" | |
> | |
<input type="hidden" | |
name="fields[judgeSelections][new1][fields][memberId]" | |
value="{{ currentUser.id }}" | |
> | |
{% endif %} | |
<!-- /Matrix blocks exist --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment