feed-me
feed-me copied to clipboard
Craft's Alternative Text field is not available on Asset Feeds
Description
Craft's native Alternative Text field is not available on the mapping configuration panel for volumes that include it. My current workaround is to use a custom field for imported alt-text content, and either use conditionals to hide the custom field (if the native alt
field is not null), or use the resave/assets
command to move content from the custom field to the native one.
Thanks in advance for any support you can provide!
Steps to reproduce
- On a project with the FeedMe plugin installed: Create an Asset Volume (ie: Images).
- Add Craft's native "Alternative Text" field (with handle:
alt
) - Create a new Feed:
- Name, URL, Type: (data that includes assets and alt text)_
- Element Type: Asset
- Asset Volume: (Volume created in step 1)
- Import Strategy: n/a
- Verify Primary Element, and Pagination URL settings
- Asset Fields
- Available fields include: title, URL/path, Filename, Folder, and Asset ID.
- Content Fields section is present, but the native Alternative Text field is not available.
- Any added custom fields are available.



Additional info
- Craft version: Craft Pro 4.2.5.2
- PHP version: 8.1.9
- Database driver & version: MySQL 8.0.30
- Plugins & versions: 5.0.4
I have the same or a similar problem. I have an Asset field I'm importing as part of a blog post. However, its "Inner Element Fields", including alt text, aren't mappable. My impression from reading https://docs.craftcms.com/feed-me/v4/content-mapping/field-types.html#inner-element-fields is that I should be able to map the alt text field.
Also, this appears to be a duplicate of #1192, but with more detail
I cobbled together a temporary fix. I'll look at creating a PR for this, but I'll need to review the commit guidelines and clean it up a bit.
The mapping of inner element fields seems to have been a problem for a while. Unable to set inner element fields on asset field #1125 This is major issue for me, as I'm trying to import entries from an old EE site where the caption and credit fields were part of the entry (inside a Grid field) and not the asset.
I wound up just pre-processing my feeds so I could import assets first, then import the other entries that rely on them. This allowed me to have better control over the assets import.
I tried the temporary fix you suggested and it seems to have worked ok. Just don't understand why Craft haven't fixed this long term issue that seems to have a simple fix.
@i-just Wanted to bump this as the Alt Text native field is still not appearing in the latest version of Feed Me (5.2.0). I made @brianjhanson's changes manually and it does allow the Alt Text field to appear in the mapping screen, although I haven't been able to confirm if it actually works with an import quite yet. Any chance we can get those changes merged in / looked at again?
Edit: I was able to confirm the functionality works as well