Out of the box, image file entities have alt and title text fields attached, field_file_image_alt_text
and field_file_image_title_text
respectively, that provide the rendered image with an HTML alt and title text.
Today I feel like Mysite.com
would be a great title for the images on my website, and I could easily programatically populate both text fields with Mysite.com
upon upload of the image file. However, what if tommorrow I change my mind and instead of Mysite.com
I want the alt and title text to be Welcome to Mysite.com
? I would have to edit all file entities and modify both text fields for each.
Is there a way to render the alt and title text through a theming function so that I do not have to actually store the alt and title text within each file entity? I want to be able to modify the alt and title texts of all images by just modifying a single line of code.