feed-me icon indicating copy to clipboard operation
feed-me copied to clipboard

Craft's Alternative Text field is not available on Asset Feeds

Open brionwolf opened this issue 2 years ago • 7 comments

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

  1. On a project with the FeedMe plugin installed: Create an Asset Volume (ie: Images).
  2. Add Craft's native "Alternative Text" field (with handle: alt)
  3. 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
  4. Verify Primary Element, and Pagination URL settings
  5. 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.
Screenshot of the feedme field mapping configuration panel for assets Screenshot for the field layout of a volume with craft alternative text field Screenshot of the feedme field mapping configuration panel focused on custom fields

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

brionwolf avatar Oct 11 '22 14:10 brionwolf

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.

jacobalvarez avatar Nov 17 '22 15:11 jacobalvarez

Also, this appears to be a duplicate of #1192, but with more detail

jacobalvarez avatar Nov 17 '22 15:11 jacobalvarez

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.

jacobalvarez avatar Nov 17 '22 23:11 jacobalvarez

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.

paul-frost avatar Dec 18 '22 17:12 paul-frost

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.

jacobalvarez avatar Dec 20 '22 15:12 jacobalvarez

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.

paul-frost avatar Dec 20 '22 18:12 paul-frost

@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

brandonjjon avatar Oct 12 '23 16:10 brandonjjon