Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like to be able to change the title of my contact form in the modal window from being just "Contact" to something more descriptive. Is this possible? Seems like it is hard-coded.
Comments
Comment #1
cluke009 CreditAttribution: cluke009 commentedThis might help http://drupal.org/node/467660#comment-4609918
Comment #2
michaellenahan CreditAttribution: michaellenahan commentedThe solution suggested by #1 changes the title for the default (non-pop-up) contact form.
However, even when the non-pop-up contact form's title is changed, the title text 'Contact' is given to the contact pop-up form by this code - so the original-poster is correct - the title-text 'Contact' is hard-coded into the module.
version 7.x-1.0
modal_forms.pages.inc (lines 104-120)
I have commented out this line:
// 'title' => t('Contact'),
... so that the title of the non-pop-up contact form comes through unchanged.
This means that now, the solution in #1 will work as long as this line is commented out.
I know that this is hacking the module file - if anyone out there can add a suggestion on how to do this in an override rather than a hack, please let me know!
Otherwise I'll suggest this as a patch to the modal_forms module - it's best for the module not to override the form title.
Grateful for your thoughts!
Comment #3
frjo CreditAttribution: frjo commented@michaellenahan, I have committed your suggestion to 7-dev. Letting the default title be used instead of hardcoding it make a lot more sense. Thanks for suggesting it.