Checking if a matrix field with entries has more than one entry In my HTML-prototype I have two ways of showing a module of employees. One version shows one employee, and the other shows two. 

To build this in Craft I have setup a Matrix field (with a handle named 'contactMatrix'). It contains a headline, some text and an entry field to pick employees (with a limit of two).

To output this in my front end I need a way to check if the user has picked one or two employees. Something like:

if one employee within the matrix field is chosen
do this html
else
if two employees within the matrix field is chosen
do this slightly different html
end if

Help, anyone?
I believe the code below should work. This code assumes you are on a single entry page or within a loop and your entry is available to you with the entry variable. You may need to adjust the block.type name and block.employees entries field name to match your proper handles. I've added comments inline to clarify each step:

{# Loop through your Matrix Field #}
{% for block in entry.contactMatrix %}

    {# Check to see which type of block you have.  You only want to check for the employees entry field if you are within the contact block #}
    {% if block.type == 'contact' %}

        {# See if your employees entries field has more than 1 entry #}
        {% if block.employees|length &gt; 1 %}

          {# Output HTML for blocks with multiple employees #}

        {% else %}

          {# Output HTML for blocks with zero or one employee #}

        {% endif %}

    {% endif %}

{% endfor %}