Configuration¶
Basic Setup¶
After installation, configure the module on any entity with image and link fields.
Step 1: Add Image and Link Fields¶
Create an entity type (e.g., Node, Custom Block, Paragraph) with:
- Image field — Standard Drupal image field
- Link field — Standard Drupal link field
Step 2: Configure Manage Display¶
Navigate to the Manage Display page for your entity:
- Example path for Page content type:
/admin/structure/types/manage/page/display - Example path for Custom Block:
/admin/structure/block/block-content/types/manage/block_type/display
Step 3: Select the Formatter¶
For the Image field:
- Click the Image field formatter dropdown
- Select one of:
-
Image wrapped within link field(standard images) -Responsive image wrapped within link field(responsive images, if sub-module enabled) - Click Configure (gear icon)

Step 4: Link Configuration¶
In the formatter settings form:
- Image Link dropdown — Select the link field to wrap the image
- Click Update
Formatter Settings¶
Image Formatter Options¶
All core image formatter settings remain available:
- Image style — Apply responsive sizing or effects
- Link image to — Select which link field provides the URL
- Alt text — From image field's alt text
Responsive Image Formatter Options (Sub-module)¶
When using responsive_image_link_formatter:
- Responsive image style — Use art direction breakpoints
- Link image to — Select which custom link field provides the URL
Field Delta Matching¶
Important: Link fields are matched to images by delta (position).
Example with 3 image/link pairs:
| Delta | Image | Link Field Value |
|---|---|---|
| 0 | Image 1 | Link 1 URL |
| 1 | Image 2 | Link 2 URL |
| 2 | Image 3 | Link 3 URL |
Each image uses the link at the same position.
Testing Your Configuration¶
- Create content with multiple images and links
- View the page — Images should be wrapped in link tags
- Inspect HTML — Should see:
<a href="..."><img .../></a>
Common Configuration Examples¶
Simple Ad Block¶
Create a "Featured Ad" custom block type:
Block Content
├── field_ad_image (Image) → Formatter: Image wrapped within link field
└── field_ad_link (Link) → Referenced in formatter settings
Product Carousel¶
Create a "Product" paragraph:
Paragraph
├── field_product_images (Image, multiple) → Responsive formatter
└── field_product_links (Link, multiple) → Matched by delta
Multi-language Support¶
Use Core's translation system:
- Enable Content Translation for your entity
- Configure translation fields for both image and link
- The formatter respects language-specific translations
Troubleshooting¶
"Link field not appearing in dropdown"¶
- Ensure the Link field is on the same entity as the image field
- Check that the field is added to the same bundle
- Rebuild cache:
drush cr
Links not wrapping images¶
- Verify link field has values
- Check that image and link deltas match (position 0→0, 1→1, etc.)
- Inspect HTML to confirm
<a>tag wraps<img>