Channel Images Documentation

Using Channel Images With Coilpack

Requirments

  1. Coilpack working and already installed
  2. Channel Images Version 7.6.0

All of the below examples can also be seen in the templates example folder when getting the addon.

Twig

The main Images Tag Example

    
        {% for theimage in exp.channel_images.images({entry_id: '36'}) %}
            <img src={{ attribute(theimage, 'image:url') }}> </img>
            {{ attribute(theimage, 'image:url') }}
            {{ theimage['image:url']}}
        {% endfor %}
    

The Fieldtype Example This following example assumes that:

  1. You have a channel images field named "channel_images"
  2. That "channel_images" field is in a channel called "my_channel"

The ".files" part will be consistent for all channel images fields. **(Note, the only time "image:" part may differ if you are using prefixes in nested tags)

    
        {% for entry in exp.channel.entries({channel: "my_channel",}) %}
            <h1> {{ entry.title }} </h1>
            <br>
            {% for image in entry.channel_images.files %}
                <img src={{ attribute(image, 'image:url') }}> </img>
                <p>{{attribute(image, 'image:url')}} </p>
            {% endfor %}
            <br>
        {% endfor %}
    

Blade

The main Images Tag Example for Blade

    
        @foreach($exp->channel_images->images(["entry_id" => "36"]) as $theimage)
            {{ $theimage['image:url'] }}
        @endforeach
    

The Fieldtype Example

    
        @foreach($exp->channel->entries(["channel" => "channel_images"]) as $entry)
            {{ $entry->title }}
            @foreach($entry->channel_images->files as $file)
                        {{$file["image:url"]}}
            @endforeach
        @endforeach
    

Support

Having problems setting up and/or using Channel Images? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.