Husband & Wife Mailing Labels with kid options
Imports: 2

Prints Avery labels like default Household label but with 'Husband & Wife' Note: If there are more than 2 adults in the Household, the label will look wonky.

Preview

Report Preview


<!-- Quick Customization

Version: 2020.12.16

ADULT NAME FORMATTING:

    CHANGE BELOW TO CHOOSE HOW TO ORDER ADULTS (gender, primary, alpha)
    {% assign orderby = "gender" %}

    CHANGE BELOW TO F TO DISPLAY FEMALE FIRST
    {% assign gender_first = "m" %}

CHILD NAME FORMATTING:
		
		Change below to choose how to order children (oldest, youngest, alpha)
		{% assign child_orderby = "oldest" %}

Option 1:
First Name & First Name Last Name
John & Jane Jones

Option 2:
First Name and First Name Last Name
John and Jane Jones

Option 3:
Mr. and Mrs. First Name Last Name
Mr. and Mrs. John Jones

Option 4:
Prefix First Name Last Name & Prefix First Name Last Name
Rev. John Jones & Dr. Jane Jones

Option 5:
First Name & First Name Last Name
Kids Names
John & Jane Jones
Jimmy, James, Jenny

Option 6:
First Name and First Name Last Name
Kids Names
John and Jane Jones
Jimmy, James, Jenny

Option 7
First Name, First Name, & First Name Last Name
John, Mary, & Joseph Jones

Option 8:
First Name Last Name, First Name Last Name, & First Name Last Name
John Jones, Mary Martha, & Joseph Jessup

CHOOSE FORMATTING OPTION ABOVE AND ENTER CORRESPONDING NUMBER:
{% assign name_formatting = "1" %}
{% assign no_show = "Mr.,Mrs.,Miss,Ms." | split: "," %}

USED FOR SHOWING SINGLE ADULTS, ADD MORE PER ACCOUNT WITH COMMA SEPARATING:
{% assign marital_filter = "Single,Divorced,Widowed" | Split: "," %}


To print a label with the household name, set to true
To print labels with the last name of the primary contact, set to false
{% assign print_household_name = true %}

To only print labels for people who have an address, set the below to true
To print labels for every household in the list, set to false
{% assign address_present = true %}

-->
{{ helpers.bootstrap_3 }}
<html>
  <head>
    <title>Avery Labels (1" x 2 5/8" - 5160)</title>
    <style>
      @page { margin: 0.5in 0in 0in 0.0825in; size: US-Letter; }
      ul { margin: 0 0 0 0.1in; padding: 0; }
      ul.labels li {
        margin: 0 0.14in 0 0;
        padding: 0;
        float: left;
        width: 2.625in;
        height: 1in;
        display: block;
        font-size: 11pt;
      }
      ul.labels li div.address {
        margin-left: 0.125in;
        margin-top: 0.1in;
      }
      
      .kids {font-size:9pt;}
    </style>
  </head>
  <body>
    <ul class="labels">
      {% assign sorted_households = households | sort: 'name' %}
      {% for household in sorted_households %}
      {% assign male_name = "" %}
      {% assign male_pre = "" %}
      {% assign female_pre = "" %}
      {% assign female_name = "" %}
      {% assign name_list = "" | split: "," %}
      {% assign kids_name_list = "" %}
       {% assign skip_adults = "no" %}
        {% if household.primary_address or address_present == false %}
          {% if print_household_name == true %}
            <li>
              <div class="address">
               {% if name_formatting == "1" %}
                    {% for adult in household.active_adults %}
                     {% if adult.marital_status == "Married" and household.active_adults.size > 1 %} 
                        {% if adult.gender == "M" %}{% assign male_name = adult.first_name %}{% assign last = adult.last_name %}{% endif %}
                        {% if adult.gender == "F" %}{% assign female_name = adult.first_name %}{% endif %}
                        {% if adult.first_name == household.primary_contact.first_name %}
                            {% assign pri_name = adult.first_name %}
                        {% else %}
                            {% assign oth_name = adult.first_name %}
                        {% endif %}
                        {% assign name_list = name_list | append: adult.first_name | append: "," %}
                        {% assign skip_adults = "yes" %}	
                     {% elsif household.active_adults.size == 1 or marital_filter contains adult.marital_status and adult.marital_status != "" %}
                      {% if skip_adults == "no" %}
                      {% unless no_show contains adult.name_prefix %}{{ adult.name_prefix }} {% endunless %}{{ adult.first_name }} {% assign last = adult.last_name %}
                      {% endif %}
                     {% endif %}
                    {% endfor %}
                    {% if skip_adults == "yes" %}
                      {% if orderby == "gender" %}
                        {% if gender_first == "m" %}
                          {{ male_name }} & {{ female_name }}
                        {% elsif gender_first == "f" %}
                          {{ female_name }} & {{ male_name }}
                        {% endif %}
                      {% elsif orderby == "primary" %}
                        {{ pri_name }} & {{ oth_name }}
                      {% elsif orderby == "alpha" %}
                        {% assign name_list_sorted = name_list | remove: "[]" | split: "," | sort %}
                        {% for name in name_list_sorted %}
                         {% unless forloop.first %} & {% endunless %}{{ name }}
                        {% endfor %}
                      {% endif %}
                    {% endif %} {{last}}
               {% elsif name_formatting == "2" %}
                    {% for adult in household.active_adults %}
                     {% if adult.marital_status == "Married" and household.active_adults.size > 1 %} 
                        {% if adult.gender == "M" %}{% assign male_name = adult.first_name %}{% endif %}
                        {% if adult.gender == "F" %}{% assign female_name = adult.first_name %}{% endif %}
                        {% if adult.first_name == household.primary_contact.first_name %}
                            {% assign pri_name = adult.first_name %}
                        {% else %}
                            {% assign oth_name = adult.first_name %}
                        {% endif %}
                        {% assign name_list = name_list | append: adult.first_name | append: "," %}
                        {% assign skip_adults = "yes" %}	
                     {% elsif household.active_adults.size == 1 or marital_filter contains adult.marital_status and adult.marital_status != "" %}
                      {% if skip_adults == "no" %}
                      {% unless no_show contains adult.name_prefix %}{{ adult.name_prefix }} {% endunless %}{{ adult.first_name }}
                      {% endif %}
                     {% endif %}
                     {% assign last = adult.last_name %}
                    {% endfor %}
                    {% if skip_adults == "yes" %}
                      {% if orderby == "gender" %}
                        {% if gender_first == "m" %}
                          {{ male_name }} and {{ female_name }}
                        {% elsif gender_first == "f" %}
                          {{ female_name }} and {{ male_name }}
                        {% endif %}
                      {% elsif orderby == "primary" %}
                        {{ pri_name }} and {{ oth_name }}
                      {% elsif orderby == "alpha" %}
                        {% assign name_list_sorted = name_list | remove: "[]" | split: "," | sort %}
                        {% for name in name_list_sorted %}
                         {% unless forloop.first %} and {% endunless %}{{ name }}
                        {% endfor %}
                      {% endif %}
                    {% endif %} {{last}}
               {% elsif name_formatting == "3" %}
                    {% for adult in household.active_adults %}
                     {% if adult.marital_status == "Married" and adult.gender == "M" %}
                      Mr. and Mrs. {{ adult.first_name }}
                      {% assign skip_adults = "yes" %}
                     {% elsif household.active_adults.size < 2 or marital_filter contains adult.marital_status and adult.marital_status != "" %}
                      {% if skip_adults == "no" %}
                      {{ adult.name_prefix }} {{ adult.first_name }}
                      {% endif %}
                     {% endif %}
                     {% if forloop.last %}{{ adult.last_name }}{% endif %}
                    {% endfor %}
               {% elsif name_formatting == "4" %}
                    {% for adult in household.active_adults %}
                     {% if adult.marital_status == "Married" and household.active_adults.size > 1 %} 
                        {% if adult.gender == "M" %}
                					{% assign male_name = adult.first_name %}
                					{% assign male_pre = adult.name_prefix%}
                				{% endif %}
                        {% if adult.gender == "F" %}
                					{% assign female_name = adult.first_name %}
                					{% assign female_pre = adult.name_prefix %}
                				{% endif %}
                        {% if adult.first_name == household.primary_contact.first_name %}
                            {% assign pri_name = adult.first_name %}
                						{% assign pri_pre = adult.name_prefix %}
                        {% else %}
                            {% assign oth_name = adult.first_name %}
                						{% assign oth_pre = adult.name_prefix %}
                        {% endif %}
         								{% unless no_show contains adult.name_prefix %}
                					{% assign pre_use = adult.name_prefix | append: " " %}
                				{% else %}
                					{% assign pre_use = "" %}
                				{% endunless %}
                        {% assign name_list = name_list | append: pre_use | append: adult.first_name | append: "," %}
                        {% assign skip_adults = "yes" %}	
                     {% elsif household.active_adults.size == 1 or marital_filter contains adult.marital_status and adult.marital_status != "" %}
                      {% if skip_adults == "no" %}
                      {% unless no_show contains adult.name_prefix %}{{ adult.name_prefix }} {% endunless %}{{ adult.first_name }} {{ adult.last_name }}
                      {% endif %}
                     {% endif %}
                     {% assign last = adult.last_name %}
                    {% endfor %}
                    {% if skip_adults == "yes" %}
                      {% if orderby == "gender" %}
                        {% if gender_first == "m" %}
                          {% unless no_show contains male_pre %}{{ male_pre }} {% endunless %}{{ male_name }} {{last }} & {% unless no_show contains female_pre %}{{ female_pre }} {% endunless %}{{ female_name }} {{ last }}
                        {% elsif gender_first == "f" %}
                          {% unless no_show contains female_pre %}{{ female_pre }} {% endunless %}{{ female_name }} {{last }} & {% unless no_show contains male_pre %}{{ male_pre }} {% endunless %}{{ male_name }} {{ last }}
                        {% endif %}
                      {% elsif orderby == "primary" %}
                        {% unless no_show contains pri_pre %}{{ pri_pre }} {% endunless %}{{ pri_name }} {{ last }} & {% unless no_show contains oth_pre %}{{ oth_pre }} {% endunless %}{{ oth_name }} {{ last }}
                      {% elsif orderby == "alpha" %}
                        {% assign name_list_sorted = name_list | remove: "[]" | split: "," | sort %}
                        {% for name in name_list_sorted %}
                         {% unless forloop.first %} & {% endunless %}{{name}} {{ last }}
                        {% endfor %}
                      {% endif %}
                    {% endif %}
               {% elsif name_formatting == "5" %}
                    {% for adult in household.active_adults %}
                     {% if adult.marital_status == "Married" and household.active_adults.size > 1 %} 
                        {% if adult.gender == "M" %}{% assign male_name = adult.first_name %}{% endif %}
                        {% if adult.gender == "F" %}{% assign female_name = adult.first_name %}{% endif %}
                        {% if adult.first_name == household.primary_contact.first_name %}
                            {% assign pri_name = adult.first_name %}
                        {% else %}
                            {% assign oth_name = adult.first_name %}
                        {% endif %}
                        {% assign name_list = name_list | append: adult.first_name | append: "," %}
                        {% assign skip_adults = "yes" %}	
                     {% elsif household.active_adults.size == 1 or marital_filter contains adult.marital_status and adult.marital_status != "" %}
                      {% if skip_adults == "no" %}
                      {% unless no_show contains adult.name_prefix %}{{ adult.name_prefix }} {% endunless %}{{ adult.first_name }}
                      {% endif %}
                     {% endif %}
                     {% assign last = adult.last_name %}
                    {% endfor %}
                    {% if skip_adults == "yes" %}
                      {% if orderby == "gender" %}
                        {% if gender_first == "m" %}
                          {{ male_name }} & {{ female_name }}
                        {% elsif gender_first == "f" %}
                          {{ female_name }} & {{ male_name }}
                        {% endif %}
                      {% elsif orderby == "primary" %}
                        {{ pri_name }} & {{ oth_name }}
                      {% elsif orderby == "alpha" %}
                        {% assign name_list_sorted = name_list | remove: "[]" | split: "," | sort %}
                        {% for name in name_list_sorted %}
                         {% unless forloop.first %} & {% endunless %}{{ name }}
                        {% endfor %}
                      {% endif %}
                    {% endif %} {{last}}
                		{% for child in household.active_children %}
                    	{% assign kids_name_list = kids_name_list | append: "[" | append: "Name:" | append: child.first_name | append: "," | append: "Age:" | append: child.age | append: "]" | append: "+" %}
                    {% endfor %}
                		{% assign kid_split = kids_name_list | split: "+" %}
                		{% if child_orderby == "alpha" %}
                			{% assign kid_sorted = kid_split | sort: child.first_name %}
                		{% elsif child_orderby == "oldest" %}
                			{% assign kid_sorted = kid_split | sort: child.age | reverse %}
                		{% elsif child_orderby == "youngest" %}
                			{% assign kid_sorted = kid_split | sort: child.age %}
                		{% endif %}
                		<span class="kids">
                		{% for kid in kid_sorted %}
                			{% assign kname = kid | split: "," %}
                      	{% if forloop.first %} <br/> {% endif %}
                      	{{kname.first | remove: "[Name:"}}{% unless forloop.last %}, {% endunless %}
                		{% endfor %}
                		</span>
               {% elsif name_formatting == "6" %}
                    {% for adult in household.active_adults %}
                     {% if adult.marital_status == "Married" and household.active_adults.size > 1 %} 
                        {% if adult.gender == "M" %}{% assign male_name = adult.first_name %}{% endif %}
                        {% if adult.gender == "F" %}{% assign female_name = adult.first_name %}{% endif %}
                        {% if adult.first_name == household.primary_contact.first_name %}
                            {% assign pri_name = adult.first_name %}
                        {% else %}
                            {% assign oth_name = adult.first_name %}
                        {% endif %}
                        {% assign name_list = name_list | append: adult.first_name | append: "," %}
                        {% assign skip_adults = "yes" %}	
                     {% elsif household.active_adults.size == 1 or marital_filter contains adult.marital_status and adult.marital_status != "" %}
                      {% if skip_adults == "no" %}
                      {% unless no_show contains adult.name_prefix %}{{ adult.name_prefix }} {% endunless %}{{ adult.first_name }}
                      {% endif %}
                     {% endif %}
                     {% assign last = adult.last_name %}
                    {% endfor %}
                    {% if skip_adults == "yes" %}
                      {% if orderby == "gender" %}
                        {% if gender_first == "m" %}
                          {{ male_name }} and {{ female_name }}
                        {% elsif gender_first == "f" %}
                          {{ female_name }} and {{ male_name }}
                        {% endif %}
                      {% elsif orderby == "primary" %}
                        {{ pri_name }} and {{ oth_name }}
                      {% elsif orderby == "alpha" %}
                        {% assign name_list_sorted = name_list | remove: "[]" | split: "," | sort %}
                        {% for name in name_list_sorted %}
                         {% unless forloop.first %} and {% endunless %}{{ name }}
                        {% endfor %}
                      {% endif %}
                    {% endif %} {{last}}
                		{% for child in household.active_children %}
                    	{% assign kids_name_list = kids_name_list | append: "[" | append: "Name:" | append: child.first_name | append: "," | append: "Age:" | append: child.age | append: "]" | append: "+" %}
                    {% endfor %}
                		{% assign kid_split = kids_name_list | split: "+" %}
                		{% if child_orderby == "alpha" %}
                			{% assign kid_sorted = kid_split | sort: child.first_name %}
                		{% elsif child_orderby == "oldest" %}
                			{% assign kid_sorted = kid_split | sort: child.age | reverse %}
                		{% elsif child_orderby == "youngest" %}
                			{% assign kid_sorted = kid_split | sort: child.age %}
                		{% endif %}
                		<span class="kids">
                		{% for kid in kid_sorted %}
                			{% assign kname = kid | split: "," %}
                      	{% if forloop.first %} <br/> {% endif %}
                      	{{kname.first | remove: "[Name:"}}{% unless forloop.last %}, {% endunless %}
                		{% endfor %}
                		</span>
               {% elsif name_formatting == "7" %}
                    {% for adult in household.active_adults %}
                			{% if forloop.length == 1 %}
                				{{ adult.first_name }}
                			{% elsif forloop.length == 2 %}
                				{{ adult.first_name }}{% unless forloop.last %} & {% endunless %}
                			{% else %}
                				{% if forloop.last %}& {% endif %}{{ adult.first_name }}{% unless forloop.last %}, {% endunless %}
                			{% endif %}
                		  {% if forloop.last %} {{ adult.last_name }}{% endif %}
                		{% endfor %} 
               {% elsif name_formatting == "8" %}
                    {% for adult in household.active_adults %}
                			{% if forloop.length == 1 %}
                				{{ adult.first_name }} {{ adult.last_name}}
                			{% elsif forloop.length == 2 %}
                				{{ adult.first_name }} {{ adult.last_name }}{% unless forloop.last %} & {% endunless %}
                			{% else %}
                				{% if forloop.last %}& {% endif %}{{ adult.first_name }} {{ adult.last_name }}{% unless forloop.last %}, {% endunless %}
                			{% endif %}
                		{% endfor %} 
               {% endif %}
                <br/>{{ household.primary_address.street }}
                <br>{{ household.primary_address.city }} {{ household.primary_address.state }} {{ household.primary_address.zip }} 
              </div>
            </li>
          {% else %}
            <li>
              <div class="address">
                The {{ household.primary_contact.last_name }} Household<br>
                {{ household.primary_address.street }}
                {{ household.primary_address.city }} {{ household.primary_address.state }} {{ household.primary_address.zip }} 
              </div>
            </li>      			
          {% endif %}
        {% endif %}
      {% endfor %}
    </ul>
  </body>
</html>