Closed (duplicate)
Project:
ImageField Extended
Version:
6.x-4.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2008 at 03:09 UTC
Updated:
17 May 2011 at 13:59 UTC
Jump to comment: Most recent file
Comments
Comment #1
kyeranr commentedI second this, It would be a useful feature.
Comment #2
quicksketchI agree it would be useful also. This issue may be affected by #193887: Accessibility enhancements.
Comment #3
realityloop commentedPatch against head attached (if alt text is enabled then it is a required field)
Comment #4
andrewmacpherson commentedJames asked for the option to make it a required field. Realiltyloop's patch only allows a mandatory alt field, or no alt field at all.
I am strongly against making the ALT field compulsory wherever it is enabled, if that is the only option.
May I propose an alternative? Modify the ALT text settings settings form like so:
[ ] disabled
[ ] optional
[ ] required
Not every image requires ALT text, even where the image is meaningful rather than purely decorative. Having optional ALT text is very useful where images are used to accompany text, such as a blog-entry content-type, but it can also get in the way when the image accompanies well written text.
For a good explanation of the use case for optional ALT text, read The Alt and Accessibility.
For a good example of unnecessary ALT text, see the screenshot in Duke using Drupal ;-0
Comment #5
andrewmacpherson commentedHere's another patch; this one provides a disabled/optional/required setting for ALT text.
So far I've only tested it on a new installation of the ImageField module, not a site with existing fields. Looking at the widget_settings array, I don't think this will need an update function in imagefield.install
Have I missed something? I'm still learning CCK. Seems too easy.
Comment #6
span commentedSeems to work perfectly for me.
Comment #7
mrfelton commentedWhilst the attached patch does add a red star to the field and make it look like it is required, I managed to add an image with no alt text regardless.
EDIT: Actually, I can create a NEW node with an imagefield that has no alt text, but I can't EDIT an existing one and leave the alt text blank. So.. I can create a new node, add an image (no alt text) and save. Then if I try to edit that node again I can not save until I enter something for the alt text.
Comment #8
mrfelton commentedTry this version instead. The problem was in:
Which should be rewritten as follows, since $default_alt does not really represent if type is #value:
Comment #9
mrfelton commentedI think this should be extended to the title field also. This means that for some imagefields we can mark both alt and title as required, ensuring quality meta data that is good for both search engines and humans.
My use case is that for certain imagefields (the lead image for a particular content type) I want to ensure that alt text is provided for search engines and I also want to ensure that a title tag is provided for captions. The ability to mark both of these attributes as required helps to ensure consistent site-wide tagging of images.
Comment #10
roalty commentedPatch #5 works well, but ALT field didn't really required like #7 said.
After changing
if ($default_alt) {toif (!$field['widget']['custom_alt']) {default values didn't show anymore. Field is clean.Comment #11
PhilDHD commentedThanks mrfelton, #9 worked perfectly for me.
Comment #12
skylord commented#9 works OK - thank you.
Comment #13
quicksketchConsidering ImageField has been moved into Drupal core and does NOT include this functionality, I think for the long-term sustainability of this feature this should be implemented in ImageField Extended, which will continue to exist in the Drupal 7 era. I'm moving this issue over there to see what the maintainer thinks of this idea.
Comment #14
alan d. commentedI marking as a duplicate of #879512: List of feature requests - UX improvements. which would extend the functionality of the module significantly.
Comment #15
crea commentedSubs