Skip to content

Instantly share code, notes, and snippets.

@scottgruber
Created September 19, 2016 23:07
Show Gist options
  • Save scottgruber/86c6c5a27c46c94cd479611b78d66ec8 to your computer and use it in GitHub Desktop.
Save scottgruber/86c6c5a27c46c94cd479611b78d66ec8 to your computer and use it in GitHub Desktop.
Using perch:if not-exists="perch_item_last" to add comma or closing period in a list
<perch:repeater id="authors" label="Author(s)" order="2">
<perch:content id="firstname" type="smarttext" chars="1" label="First Name/Initial" required="true" /><perch:if exists="firstname">. </perch:if><perch:content id="middlename" type="smarttext" chars="1" label="Middle Name/Initial"/><perch:if exists="middlename">. </perch:if> <perch:content id="lastname" type="smarttext" label="Last Name" required="true"/><perch:if not-exists="perch_item_last">, <perch:else />. </perch:if>
</perch:repeater>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment