Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Thank you, Berdir. {{ kint(node.field_blog_author.entity) }} does output a nice array of the referenced node, but now I can't go deeper. {{ kint(node.field_blog_author.entity.title) }}, for example, breaks the page, loading no resources or anything past the header region. Same for nid or others. Just for giggles, trying to include the referenced entity in the node content with {{ node.field_blog_author.entity }} returned an error message seemingly saying that the node couldn't be shown in the template like that. Commented Apr 21, 2016 at 14:26
  • It looks like these might be protected values. Does that sound right? Maybe I need to create a view mode for just the photo then use the "label" display mode for the name. Commented Apr 21, 2016 at 14:31
  • Yes, they are protected. As I said, use toArray(), which also works on node.field_blog_author.entity.title is a field object, if you want to value, you need ...entity.title.value. Make sure to read the referenced cheat sheet, it explains a lot of those things. Commented Apr 21, 2016 at 15:08
  • 1
    I appreciate the help. I don't really understand how to use the information in the cheat sheet, however. Adding .value did work in this case and answers my original question. Commented Apr 21, 2016 at 15:57
  • @berdir the site url is broke. Commented Apr 13, 2020 at 13:35