Timeline for Add prefix / suffix to field by using template_preprocess_field
Current License: CC BY-SA 4.0
21 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 10 at 0:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jul 8 at 7:02 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 29 at 18:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Oct 30, 2023 at 17:00 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jun 29, 2023 at 10:06 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 17, 2023 at 2:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Oct 19, 2022 at 20:01 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jun 20, 2022 at 15:05 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 16, 2022 at 10:00 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Oct 17, 2021 at 0:07 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jun 17, 2021 at 23:03 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Feb 1, 2021 at 0:08 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Oct 3, 2020 at 12:06 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jun 5, 2020 at 2:04 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Apr 27, 2020 at 12:17 | answer | added | GZveri | timeline score: 0 | |
May 4, 2018 at 15:31 | comment | added | SoBiT |
Thanks! I'm now able to create prefixes and suffixed. However, the prefix is rendered inside the div.field__item - I'd like to render it outside the div.field which is 2 levels above. Is it possible?
|
|
May 4, 2018 at 14:16 | comment | added | 4uk4 |
Yes, you should be able to add a prefix/suffix to any render element, but not in $variables['element'] , because in preprocess the fields are already copied to $variables['items'] , see template_preprocess_field().
|
|
May 4, 2018 at 14:09 | comment | added | Clive♦ |
Yeah you might need to dig further down in the array - look for the child with '#type' => 'textfield' or '#type' => 'select' or whatever, that's the element that needs the prefix/suffix
|
|
May 4, 2018 at 14:00 | comment | added | SoBiT | Darn, that was stupid! Thanks! However, even after changing this, it won't work. Do I need to use the Delta Array? Or is prefix and suffix generally for a field rather than a single value inside it? | |
May 4, 2018 at 13:57 | comment | added | Clive♦ |
Yep that's still the same. You're just discarding the changes, you want $element = &$variables['element'];
|
|
May 4, 2018 at 13:55 | history | asked | SoBiT | CC BY-SA 4.0 |