1

I'm updating a site in which I need to ensure that the alt (and possibly title) attribute are enabled for any field of time file (widget image).

There are tonnes of content types and I don't want to have to go through every field in every content type to check and enable it each.

I've had a search for modules but have been unsuccessful in my search. Is there a way I can enable them in as a bulk operation in the database?

I've looked but couldn't find exactly where the setting for each field was

For example, the table content_type_source_homepage has the following fields

field_shp_image_fid     int(11)                         Yes NULL            
field_shp_image_list    tinyint(4)                      Yes NULL
field_shp_image_data    text        utf8_general_ci     Yes NULL

These obviously store a reference to the image but does not indicate whether or not the user is allowed to edit the alt attribute for that image, and what the default alt attribute might be.

Furthermore, fields which allow multiple images have a separate table such as content_field_title_image which again has similar fields without indication as to whether or not the alt attribute is editable.

3
  • to clarify, are you trying to check to see if the alt and title fields of a CCK field type image are empty?
    – blue928
    Mar 6, 2012 at 11:44
  • Not empty, available to edit by a user as if I edited a field and ticked the box which says "Enable custom alternate text Enable user input alternate text for images." Mar 6, 2012 at 12:07
  • The data you are looking for will be in the table which stores field configuration data for content types, not the table which hold field data. This is a setting that applies to the field, not individual instances of it. So unless you have got hundreds of image fields you can do this fairly quickly through the UI. May 30, 2013 at 16:26

1 Answer 1

1

Each content type will have a form associated with the content type. Using hook_form_alter, you can change these items and set them in batch.

Here is a great video that teaches how to do what you are asking, but using the author check box. Using a technique like this you could set everything to 'on' (1).

http://mustardseedmedia.com/podcast/episode53

How many is 'Tonnes' - do you have 50 content types or 500? Remember you would have to write custom code to do this, so you would need to be familiar with PHP and how modules are written. If that is not your forte and there is not a module, it may be best just to dedicate a few hours and a beer to it :)

1
  • Where abouts are the forms located? Presumably these details are stored somewhere in the database. The only table I spotted was form_cache or cache_form (I can't remember which). Mar 8, 2012 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.