1

How can i change the file field description without hacking a contrib module like the file.field.inc file ?

this is the function i would like to modify: theme_file_upload_help

0

I have accomplished similar by using a hook_form_alter() in a custom module and altering the field's #description property.

  • This would only change the field in one specific form, i would like to change it in every existing form. – Sven Mar 19 '14 at 15:58
  • hook_form_alter() affects every single form and is suitable for changing the field everywhere it appears. If you wanted only one form you would use hook_form_FORM_ID_alter(). – beth Mar 19 '14 at 15:59
0

If it's a theme function you want to override, then the way to do that is to write a function called mytheme_file_upload_help (if your theme is called mytheme).

so in your mytheme/template.php file:

function mytheme_file_upload_help($variables) {
   ... your code here
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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