Admin
...
Editorial Admin Set-up
Purple Blocks
Validating Image Blocks and Meta Information
7min
Purple Hub
This article describes how to use the Image Block and Meta Information Validation feature within Purple Hub. The feature ensures that custom fields (such as copyright ownership) are filled in and that images are included in the block. This guide will walk you through the requirements, setup and a detailed description of the feature in action.
At the moment, only custom fields (ACFs) and information about whether an image is included in the image blocks can be validated. Validation of standard fields such as alt tags, title tags, captions etc. isn't possible at the time of writing.
- Have an Admin role in Purple Hub
- Have a field group and a custom field defined that applies to images.Create Custom Fields in Purple Hub
- Have the name of your custom field by hand (e.g., 'ImageCredits' or 'MediaLibraryCopyrightOwner') that need validation.
Navigate to the Image Block:
- In Purple Hub, go to the section where Purple Blocks (image blocks) are managed.
- You can set a block as "required" for a post, meaning that the post will not be published unless the block contains valid content.
- New Validation Options:
- There are now two additional validation options for image blocks:
- Image Requirement: The block must contain an image.
- Custom Field Validation: Custom fields (such as metadata) must be filled in for each image.
- Setting Custom Field Validation:
- Copy the name of the required field (e.g., "Media Library Copyright Owner").
- In the Purple Blocks settings, specify that this field must always be filled in for images.
- Save the settings. Once saved, this requirement will be enforced in all image blocks.
- Testing the Validation:
- Create a new article and add an image block using Purple Blocks.
- Select an image from the media library that does not have the required custom field (e.g., "Media Library Copyright Owner") set.
- A warning will appear stating that the image is missing the required field, and the article cannot be published until the field is filled in.
- Resolving Validation Issues:
- To resolve the issue, either choose an image that already has the required metadata or manually set the missing field for the selected image.
- Once the field is set correctly, the warning will disappear, and the article can be published.
- Validating the Presence of an Image:
- You can also configure the image block to require that an image must be selected.
- If an image block is added without an image, a validation error will appear, preventing publication of the article until an image is selected.
- Publishing with Validated Images:
- Once all validations (image selection and custom field requirements) are satisfied, the article can be published without any errors.
- If an image is selected that does not have the required "Media Library Copyright Owner" field, a message will appear stating, "The selected image does not contain the Media Library Copyright Owner field."
- If no image is selected for an image block, another warning will appear indicating that the article cannot be published without a valid image.
Updated 20 Jan 2025
Did this page help you?