How to Set Image Validations on Fields

Follow

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

    mceclip0.png

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

    mceclip1.png

  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

    mceclip0.png

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

    • Restrict File Size  in kb

      mceclip0.png

    • Restrict Height by px

      mceclip1.png

    • Restrict Width by px

      mceclip3.png

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

      mceclip4.png

    • Add custom Validation Message

      mceclip5.png

Thumbnails

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

Comments

0 comments

Please sign in to leave a comment.