Kentico CMS 7.0 Developer's Guide

Resizing images for devices

Resizing images for devices

Previous topic Next topic Mail us feedback on this topic!  

Resizing images for devices

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

You can configure the system to automatically resize images to match the dimensions of device profiles:

 

1.Go to Site Manager -> Settings -> Content -> Content management.

2.Enable the Resize images according to device profile setting.

3.Click Save Save.

 

When a user views the website on a device that matches a certain profile, images automatically reduce their maximum side size to the larger of the dimensions set for the given profile.

 

To change the dimensions of device profiles:

 

1.Go to Site Manager -> Development -> Device profiles.

2.Edit (Edit) a profile.

3.Set the Preview width and Preview height properties (the values are in pixels).

4.Click Save Save.

 

 

InfoBox_Exclamation

 

Note

 

The resizing only works for images loaded through one of the Kentico CMS system pages (getattachment, getmetafile, getmedia, etc.). Device profile resizing does not work for images that use web links or direct paths in their source.

 

See also:

 

Linking pages and files

GetFile.aspx parameters

 

Disabling the resizing for individual images

 

If you wish to disable device profile resizing for an image, add the resizemode=1 query string parameter to the image source URL.

 

For example:

 

<img src="~/getattachment/Community/Blogs/LargeImage.png.aspx?width=800&resizemode=1">