No UI to set alt/title default values in image field settings

Created on 5 June 2024, 7 months ago
Updated 22 June 2024, 6 months ago

Problem/Motivation

I'm trying to test on a fresh install of Drupal 10.2.6 and I can't find the "Alt field settings" (pictured in the first image on the project page β†’ ) anywhere.

I added an image field to the Basic Page content type, set both the form widget and field formatter to 'ImageField Tokens', but the alt field 'Default value' field doesn't show up anywhere I can find. I checked the settings for the image field, the formatter and the widget. No luck. (See attached screenshots.)

First time installing, so I don't have previous experience to know if it worked on earlier versions. Is it correct to assume that you should be able set the token-based defaults on the field settings, and they would then be used in the formatter and widget?

What am I missing?

πŸ’¬ Support request
Status

Postponed: needs info

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @justcaldwell
  • πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas

    I don't see the function imagefield_tokens_form_field_ui_field_edit_form_alter() from the 7.x-1.x module file implemented anywhere in the later versions (8.x, 3.x, etc.). So there doesn't seem to me anything that adds the imagefield_tokens settings to the overall field settings UI?

  • πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas

    Just for good measure, here's the node edit form as well. No settings there, either β€” though I don't know why you'd want site authors choosing tokens, instead of just entering an alt value.

  • πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas

    And, yes, there's a "Browse available tokens" link, but here's the resulting code with an unprocessed token in the rendered page.

  • πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas
  • πŸ‡ΊπŸ‡ΈUnited States justcaldwell Austin, Texas
  • Status changed to Postponed: needs info 6 months ago
  • πŸ‡ΊπŸ‡¦Ukraine ysamoylenko

    Hello @justcaldwell,

    Are you sure you configured both: Widget and Formatter for the image field for your entity (Display and Form modes)?

    Token replacement will work only once you configured a compatible formatter.

    There are two formatters available:

    • ImageField Tokens
    • ImageField Tokens: ColorBox

    Widgets available:

    • ImageField Tokens
    • ImageField Tokens Widget Crop

    Here are screenshots:

    You can also configure a predefined token alt/title values for your image field inside its settings:

    Hope you find this explanation useful.

    Please reply here if you still experiencing any difficulties.

Production build 0.71.5 2024