Timeline for How to access the node title within a field template?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 9, 2016 at 9:47 | comment | added | Oana Hulpoi |
@Alex I didn't tested exactly the code. If you have the node in $variables, use it. I f not, use $node = \Drupal::request()->attributes->get('node'); to get the current node.
|
|
Jun 9, 2016 at 9:42 | comment | added | Alex | wouldnt it be cleaner to get the node from the variables? | |
Jun 9, 2016 at 9:19 | comment | added | Oana Hulpoi | @Alex I think that it should work. Did you try some debugging in php and in twig? | |
Jun 9, 2016 at 9:15 | comment | added | No Sssweat | @Alex did you try the last edit? the initial answer had typos | |
Jun 9, 2016 at 8:59 | comment | added | Alex | does not work some reason, but I will continue testing | |
Jun 9, 2016 at 8:48 | history | edited | Oana Hulpoi | CC BY-SA 3.0 |
spelling
|
Jun 9, 2016 at 8:46 | history | answered | Oana Hulpoi | CC BY-SA 3.0 |