Objective ways to print images in 5.7

This is a community-contributed tutorial. This tutorial is over a year old and may not apply to your version of Concrete CMS.
May 20, 2015

First, get page's image attribute value like:

$img = $page->getAttribute('example_image_attribute_handle');
if ($img) {
    // do something
}

Case 1: Print responsive image (if your theme supports responsive image)

$tag = Core::make('html/image', array($img))->getTag();
echo $tag;

Case 2: Add some attributes to the image

$tag = Core::make('html/image', array($img))->getTag();
$tag->alt('alt test');
$tag->title('title test');
$tag->addClass('example class');
echo $tag;

Case 3: Remove some attributes from the image

$tag = Core::make('html/image', array($img))->getTag();
$tag->width = null;
$tag->height = null;
echo $tag;

Case 4: Do not use responsive image (picture element)

$tag = Core::make('html/image', array($img, false))->getTag();
echo $tag;

Case 5: Get thumbnail src of the image

$src = $img->getThumbnailURL('small');
echo \HtmlObject\Image::create($src)->alt('small size image');

Note: Loader::helper('image') is officially deprecated.

Recent Tutorials
Setting addon/theme version compatibility in the marketplace
Jan 9, 2024

For developers worn out with setting the latest addon or theme version manually across too many core versions, here is a JavaScript bookmarklet to do it for you.

How to get the locale of a page
Jan 8, 2024
By wtfdesign.

Now, why don't we just have a getLocale() method on Page objects beats me, but here's how you work around it

Using a Redis Server
Jun 16, 2023
By mlocati.

How to configure Concrete to use one or more Redis servers to persist the cache.

Using the Concrete Migration Tool Addon
Apr 27, 2023

How to use the Concrete CMS Migration Tool

How To Add Page Last Updated To Your Concrete CMS Pages
Mar 7, 2023

Concrete CMS has a page attribute you can add to a global area called "Page Date Modified." Here's how to add it

How To Exclude Subpages from Navigation
Dec 24, 2022

How to exclude subpages from navigation - useful for a news or blog link in your main navigation where you don't want all the subpages to appear in a drop down menu.

Improvements?

Let us know by posting here.