1

I want to modify the default Link field, so that instead of just a text field it will always have a Validate Button next to it (for active checking).

I don't want to create a new Widget, I want to override the basic link, so that any link field deriving from the original will inherit these changes. Also of course, is it then possible to override the override (for a specific link variant - say, Twitter link, to change this new button to a checkbox or just remove it for that type)? Can I just add in my custom module the link_widget_info() function?

Thanks!

1 Answer 1

1

You can do that with hook_field_widget_form_alter

hook_field_widget_form_alter(&$element, &$form_state, $context)

Alter forms for field widgets provided by other modules.

The function parameters there allow you to check and target specific cases as needed.

Your Answer

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

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