Drupal 8 newbie - How to access fields inside of page.html.twig?

Viewed 602

{{ page.content.field_title.value }}

Is there anyway for me to access just the title field inside of my page.html.twig

1 Answers

To get the title, any of the following should work

{{ node.label }}
  Or
{{  page[‘#title’]}}

But, I like the following

   {% if node.title.value %}
  <h1>{{ node.title.value }}</h1>
{% elseif page['#title'] %}
  <h1>{{ page['#title'] }}</h1>
{% endif %}

From here

Related