The contributed project Field placeholder lets one use HTML5 placeholder attribute. The project page says:
By default, this module integrates text, number and mail modules, but any other widget type can be added through
hook_field_placeholder_info()
.
I've tested this with a “Text” field, and it works as advertised.
I want to add hook_field_placeholder_info()
for the
Link module.
According to field_placeholder.api.php
, this hook should return:
An array whose keys are the widget names and whose value are the widget item where the placeholder will be attached.
So far I've tried this:
/**
* Implements hook_field_placeholder_info().
*/
function mymodule_field_placeholder_info() {
return array(
'link_field' => 'value',
);
}
This puts the widget for the placeholder settings on the admin page where one manage the link file, but setting a placeholder value has no effect when I create a new node with a link field.
I believe the problem is “value
”. According to the documentation,
it should be the “widget item where the placeholder will be attached”.
I am not sure what that is. So far I've tried “value
”, “link_field
”,
“link
”, and “url
” (clearing the cache before testing each in
turn), but none of these work for the link field.
So: How to write hook_field_placeholder_info() for the link module?