How to filter what is showed based on radio button checked I am fairly new to Craft CMS coming from ruby on rails and angularjs.  I am running into an issue with attempting to display images on a home page based on whether or not the radio button titled "featured" ( a field) is selected.

I have searched around but was unable to find something addressing this, or at least in a way I understood to solve the problem.

I have been trying variations of... 

{% if thumbnails.featured %}


...hoping it would only display what has "featured" selected but it either breaks and shows nothing or shows all the images.  Based on what I have found I think I have to "set" something but am unable to figure out exactly how that is set up.  This is exactly what I have right now and it is showing all images.

{% for thumbnails in craft.assets.thumbnails %}
    {% if thumbnails.featured %}
        &lt;div class="rollover-item wd ux dv print"&gt;              
            &lt;img src="assets/img/{{ thumbnails.filename }}" alt="{{ thumbnails.filename }}"&gt;
                    &lt;a class="preview" href="work/{{ thumbnails.clientname }}"&gt;{{ thumbnails.caption }}&lt;/a&gt;                     
        &lt;/div&gt;
    {% endif %}
{% endfor %}


If anyone could suggest a solution or even point me in the right direction it would be greatly appreciated.
You will want to first create an 'elementCriteriaModel' to retrieve only the 'featured' images from the 'thumbnails' asset group, which will return an array like object (not technically an array) which you can loop through to display.

{% set images = craft.assets.group('thumbnails').featured(1) %}
{% for image in images %}
    &lt;div class="rollover-item wd ux dv print"&gt;              
        &lt;img src="assets/img/{{ image.filename }}" alt="{{ image.filename }}"&gt;
        &lt;a class="preview" href="work/{{ image.clientname }}"&gt;{{ image.caption }}&lt;/a&gt;
    &lt;/div&gt;
{% endfor %}


Another method that might be easier to manage from a client perspective is to add an assets fieldType to your homepage section (called 'featuredImages' or whatever; limited of course to the 'thumbnails' asset group) which the client can use to add and/or reorder the featured thumbnails to be displayed. In which case the code would look something more like this.

{% if entry.featuredImages|length %}
    {% for image in entry.featuredImages %}
        &lt;div class="rollover-item wd ux dv print"&gt;              
            &lt;img src="assets/img/{{ image.filename }}" alt="{{ image.filename }}"&gt;
            &lt;a class="preview" href="work/{{ image.clientname }}"&gt;{{ image.caption }}&lt;/a&gt;
        &lt;/div&gt;
    {% endfor %}
{% endif %}