How to Set Image Validations on Fields

Images are an important piece of content but special care should be taken to ensure they are optimized for the web. Images that are not sized correctly will affect page performance and potential layout issues.

Agility provides a simple way to validate Image Fields for both Content and Module definitions. You can restrict images by File Size, Height, Width, Valid File Types, and create custom Validation Message to help enforce proper image guidelines.

  1. Navigate to agility Settings


  2. Select Content Definitions or Module Definitions (for this example I will be using Content Definitions)


  3. Click on the desired content definitionmceclip0.png

  4. Click on Form Builder tabmceclip1.png

  5. Either create a new Image field or left-click an existing Image field


  6. In the File Settings section there you can perform the following validations when a user uploads a file:

    • Restrict File Size  in kb


    • Restrict Height by px


    • Restrict Width by px


    • Restrict Valid File Types - types supported are .jpg, .fig, .png, .svg, .jpeg, .bmp


    • Add custom Validation Message



There are times when images need to be used across devices with different size restrictions. Instead of creating multiple image fields for each image size, Agility provides a way for developers to request a specific image size from an image asset in their code.  How to Retrieve a Thumbnail for an Image using Querystrings in the URL


1 out of 1 found this helpful



Please sign in to leave a comment.