List entries of documents in a section grouped by checkbox I'm trying to list entries in a section which are documents. Those documents are grouped by checkbox. I'd like to list the document title and the asset in the entry's url. I only want to list assets which have a specific checkbox ticket. 

I was able to output and group the assets by checkbox, but I'm struggling to find that entries asset url. Any thoughts?

This is what I have so far:

{% set entries = craft.entries.section('documentLibrary')%}

{# get all checkbox options #}
{% set options = entries.first().documentType.options %}
{% set assets = entry.documents %}

 {% for entry in entries if entry.documentType.contains('Report') %}
    {% for asset in assets %}
       &lt;a href="{{ asset.url }}" type="application/pdf;" class="list-group-item active"&gt;{{ entry.title }}&lt;/a&gt;
    {% endfor %}
 {% endfor %}


Unfortunately as expected the {{ asset.url }} returns the url of the entry and not of the asset documents which is attached to the entry.
Your assets variable is defined outside the entries loop so it is still referring to the page entry. If you move it inside the loop it should work as expected.

{% set entries = craft.entries.section('documentLibrary') %}
{% for entry in entries if entry.documentType.contains('Report') %}
    {% for asset in entry.documents %}
       &lt;a href="{{ asset.url }}" type="application/pdf;" class="list-group-item active"&gt;{{ entry.title }}&lt;/a&gt;
    {% endfor %}
{% endfor %}


Rather than doing this manually however, you might also have a look at the group filter, which can group the entries array by document type.

{% set entries = craft.entries.section('documentLibrary').find() %}
{% set groupedEntries = entries|group('documentType') %}

{% for type, entriesByType in groupedEntries %}
    &lt;h2&gt;{{ type }}&lt;/h2&gt;
    &lt;ul&gt;
        {% for entry in entriesByType %}
            {% for asset in entry.documents %}
                &lt;a href="{{ asset.url }}" type="application/pdf;" class="list-group-item active"&gt;{{ entry.title }}&lt;/a&gt;
            {% endfor %}
        {% endfor %}
    &lt;/ul&gt;
{% endfor %}


Note: Also if each 'document' only contain one and only one 'asset' (i.e. pdf), then you can also get rid of the asset loop and just use {{ entry.document.first.url }}.