Channel Images
Contents
- Installation Instructions
- Setup Instructions
- Primary Template Tag
- Parameters
- Variables
- Conditionals
- Examples
Installation For ExpressionEngine 1.6.8
- Copy ext.channel_images_ext.php to your /system/extensions/ folder.
- Copy lang.channel_images.php to your /system/language/english/ folder.
- Copy the folder channel_images to your /system/modules/ folder.
- Copy the devdemon_themes folder to your /themes/ folder.
Installation For ExpressionEngine 2.x
- Copy channel_images to your /system/expressionengine/third_party/ folder.
- Copy the devdemon_themes folder to your /themes/ folder.
Updating to a new version of Channel Images
First before anything BACKUP! Once you have done a backup, simply replace all the Channel Images files and then visit the Channel Images Control Panel to allow the update script to run.
Setup Instruction For ExpressionEngine 2.x
- Click on Add-Ons then Modules.
- On Fieldtype and Module choose Install then submit.
- Click on Admin then Channel Administration then Custom Fields.
- Choose the Field Group you want to add Channel Images to.
- Click Create a New Custom Field.
- Choose the Field Type as Channel Images.
- Create the Label and Field Name you want for your templates.
- Return to Add-Ons then Modules.
- Choose the Channel Images module.
- You MUST enable the channel you wish to use the new custom field type in.
- Choose the Channel you want to use.
- Set the Server Location Path to a folder you want the images for that channel to upload to.
- We recommend creating a folder in the images directory with full write (chmod 777) access.
- Set the Location URL to the web path of that same directory you made.
- You can create optional categories separated with a comma if you wish. (Not required).
- The Image Sizes you keep or add will be automatically added. If you do not need multiple versions remove the sizes you don't need.
- Return to Channel Management and make sure your channel is using the custom field group you created for Channel Images.
Primary Template Tag
{exp:channel_images:images}
Special Note: Different variables and conditionals exist for ExpressionEngine 2.x. Please verify below that you are looking at the correct documentation for the version of ExpressionEngine you are using.
Tag Parameters
entry_id=""
url_title=""
cover_only="" // (Options: Yes/No - Default = No)
skip_cover="" // (Options: Yes/No - Default = No)
weblog=""
weblog_id=""
orderby="" // Options: title, order - Default = order
sort="" // Options: asc,desc -- Default = asc
limit="" // Default = 300
Variables for ExpressionEngine 1.6.8
{image_url}
{image_id}
{image_url:size} // "size" refers to the image size you set in the settings.
{image_title}
{image_description}
{image_category}
{image_count}
{total_images}
{filename}
Variables for ExpressionEngine 2.x
{image:url:size} // "size" refers to the image size you set in the settings.
{image:id}
{image:title}
{image:description}
{image:category}
{image:count}
{image:total}
{image:filename}
Conditionals for ExpressionEngine 1.6.8
{if no_images} <p>No Images Exist</p> {/if}
Conditionals for ExpressionEngine 2.x
{if image:no_images} <p>No Images Exist</p> {/if}
Channel Images Template Example for EE 1.6.8
{exp:weblog:entries weblog="default_site"}
<h2>Cover Image</h2>
{exp:channel_images:images entry_id="{entry_id}" cover_only="yes"}
<a href="{image_url}" title="{image_title}"><img src="{image_url:small}" alt="{image_title}" /></a>
<p>{image_description}</p>
{/exp:channel_images:images}
<h2>Other Images</h2>
{exp:channel_images:images entry_id="{entry_id}" skip_cover="yes"}
<a href="{image_url}" title="{image_title}"><img src="{image_url:small}" alt="{image_title}" /></a>
{/exp:channel_images:images}
<h2>All Images</h2>
{exp:channel_images:images entry_id="{entry_id}"}
<a href="{image_url}" title="{image_title}"><img src="{image_url:small}" alt="{image_title}" /></a>
{/exp:channel_images:images}
{/exp:weblog:entries}
Channel Images Template Group by Category Example for EE 1.6.8
{exp:weblog:entries weblog="default_site"}
<h2>Cover Image</h2>
{exp:channel_images:images entry_id="{entry_id}" group_by_category="yes"}
{images}
<a href="{image_url}" title="{image_title}"><img src="{image_url:small}" alt="{image_title}" /></a>
<p>{image_description}</p>
{/images}
{if no_images}<p>No Images Available</p>{/if}
{/exp:channel_images:images}
{/exp:weblog:entries}
Channel Images Template Example for EE 2.x
{exp:channel:entries channel="about"}
<h2>Cover Image</h2>
{exp:channel_images:images entry_id="{entry_id}" cover_only="yes"}
<a href="{image:url:large}" title="{image:title}"><img src="{image:url:small}" alt="{image:title}" /></a>
<p>{image:description}</p>
{/exp:channel_images:images}
<h2>Other Images</h2>
{exp:channel_images:images entry_id="{entry_id}" skip_cover="yes"}
<a href="{image:url:large}" title="{image:title}"><img src="{image:url:small}" alt="{image:title}" /></a>
{/exp:channel_images:images}
<h2>All Images</h2>
{exp:channel_images:images entry_id="{entry_id}"}
<a href="{image:url:large}" title="{image:title}"><img src="{image:url:small}" alt="{image:title}" /></a>
{/exp:channel_images:images}
{/exp:channel:entries}
