How I get the node field value in node.html.twig tpl

If you want to create tpl for a particular content type node use below naming convention

node--content_type_machine_name.html.twig

For Printing Title -  {{node.title.value}}

For Printing Body -  {{node.body.value|raw}}

For Printing Image  - {{ file_url(node.field_image.entity.fileuri) }}

For Printing reference field Value - {{node.field_author.entity.title.value}}
    field_author - entity machine name
    title -  field name that you want to print for reference entity

  suppose you want to print Entity reference image url you can use 
  {{file_url(node.field_author.entity.field_author_image.entity.fileuri)}}

No comments:

Write a program in PHP to reverse a number

A number can be written in reverse order. For example 12345 = 54321 <?php   $ num = 23456;   $ revnum = 0;   while ($ num > 1)   {   $...