Closed (fixed)
Project:
Link
Version:
7.x-1.0
Component:
Documentation
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Dec 2010 at 15:30 UTC
Updated:
16 Jul 2016 at 01:08 UTC
Jump to comment: Most recent
Comments
Comment #1
wouter99999 commentedah, I think I found it: I can do it in after_build using
$form['#after_build'][] = 'mytheme_after_build'; in mytheme_form_alter
and then doing the stuff in
function mytheme_after_build($form, &$form_state) {
//things to alter
..
return $form;
}
Comment #2
guschilds commentedFWIW, I was having trouble applying the 'placeholder' attribute to a Link field. I was applying them to other fields in hook_form_alter, but this was not possible as link_field_process() in link.module is called after that.
Assigning a function to $form['#after_build'], as shown above, I was able to assign a placeholder value to a Link field:
$form[$field_name][$field_language][0]['url']['#attributes']['placeholder'] = $placeholder;Swap $field_name, $field_language, and $placeholder appropriately.
Also, swap 'url' for 'title' if you'd like to manipulate the #attributes of the title field.
Thanks for posting your solution, wouter99999
Comment #3
guschilds commentedComment #4
jnavane commentedSorry. I removed the OFFTOPIC answer.
Comment #5
dqdOriginal issue is fixed. Last comments are OFFTOPIC.
Comment #6
arlingtonvoicellc commentedNot reopening, but adding an update to the answer. Using guschild's suggested format would not work for me. This does however:
In case anyone else hits that issue.