Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

I am trying to print an entity reference field (from paragraphs module) into a controller.
I learned from this ticketI learned from this ticket that you can use
{{ teacher.field_classrooms.entity.field_in_paragraph.value }} to get the value of one field from the entity, but what I really need is to print the whole entity not just one field from the entity.

I was hoping to do something like {{ teacher.field_classrooms.entity }} rather than {{ teacher.field_classrooms.entity.field_in_paragraph.value }} {{ teacher.field_classrooms.entity.field_different_in_paragraph.value }}.

I am trying to print an entity reference field (from paragraphs module) into a controller.
I learned from this ticket that you can use
{{ teacher.field_classrooms.entity.field_in_paragraph.value }} to get the value of one field from the entity, but what I really need is to print the whole entity not just one field from the entity.

I was hoping to do something like {{ teacher.field_classrooms.entity }} rather than {{ teacher.field_classrooms.entity.field_in_paragraph.value }} {{ teacher.field_classrooms.entity.field_different_in_paragraph.value }}.

I am trying to print an entity reference field (from paragraphs module) into a controller.
I learned from this ticket that you can use
{{ teacher.field_classrooms.entity.field_in_paragraph.value }} to get the value of one field from the entity, but what I really need is to print the whole entity not just one field from the entity.

I was hoping to do something like {{ teacher.field_classrooms.entity }} rather than {{ teacher.field_classrooms.entity.field_in_paragraph.value }} {{ teacher.field_classrooms.entity.field_different_in_paragraph.value }}.

Tweeted twitter.com/StackDrupal/status/794653505676054538
removed tags from the title
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

D8 twig render Render whole entity inside of a controller

I am trying to print an entity reference field (from paragraphs module) into a controller.
I learned from this ticket that you can use
{{ teacher.field_classrooms.entity.field_in_paragraph.value }} to get the value of one field from the entity, but what I really need is to print the whole entity not just one field from the entity.

I was hoping to do something like this

{{ teacher.field_classrooms.entity }}

  rather than

   {{ teacher.field_classrooms.entity.field_in_paragraph.value }} {{ teacher.field_classrooms.entity.field_different_in_paragraph.value }}

any help is appreciated for my twig noobness.

D8 twig render whole entity inside of a controller

I am trying to print an entity reference field (from paragraphs module) into a controller.
I learned from this ticket that you can use
{{ teacher.field_classrooms.entity.field_in_paragraph.value }} to get the value of one field from the entity, but what I really need is to print the whole entity not just one field from the entity.

I was hoping to do something like this

{{ teacher.field_classrooms.entity }}

  rather than

 {{ teacher.field_classrooms.entity.field_in_paragraph.value }} {{ teacher.field_classrooms.entity.field_different_in_paragraph.value }}

any help is appreciated for my twig noobness.

Render whole entity inside a controller

I am trying to print an entity reference field (from paragraphs module) into a controller.
I learned from this ticket that you can use
{{ teacher.field_classrooms.entity.field_in_paragraph.value }} to get the value of one field from the entity, but what I really need is to print the whole entity not just one field from the entity.

I was hoping to do something like {{ teacher.field_classrooms.entity }} rather than  {{ teacher.field_classrooms.entity.field_in_paragraph.value }} {{ teacher.field_classrooms.entity.field_different_in_paragraph.value }}.

Source Link
Brittany
  • 103
  • 1
  • 2
  • 5

D8 twig render whole entity inside of a controller

I am trying to print an entity reference field (from paragraphs module) into a controller.
I learned from this ticket that you can use
{{ teacher.field_classrooms.entity.field_in_paragraph.value }} to get the value of one field from the entity, but what I really need is to print the whole entity not just one field from the entity.

I was hoping to do something like this

{{ teacher.field_classrooms.entity }}

rather than

{{ teacher.field_classrooms.entity.field_in_paragraph.value }} {{ teacher.field_classrooms.entity.field_different_in_paragraph.value }}

any help is appreciated for my twig noobness.