Hide page title if the image field has a value I have a image field (field_image) on my content type. I want to show the image below the header with the node title inside. I am successfully doing that in page.html.twig.

{% if node.field_image %}
  &lt;div id="feature-image"&gt;
    &lt;div class="container"&gt;
      &lt;h1 class="feature-image"&gt;{{ node.label }}&lt;/h1&gt;
    &lt;/div&gt;
  &lt;/div&gt;
{% endif %}


However, the page title is also showing up in the page title block inside of the Header region. I'm trying to find a way to hide the second page title, on the full node view, if the field_image field has a value.

How can I achieve this?
This method works for me. (Thanks to kim.kennof on Slack for the assistance.)

In my THEME.theme file:

function THEME_preprocess_page_title(&amp;$variables) {
  if ($node = \Drupal::routeMatch()-&gt;getParameter('node')) {
    if ($node instanceof \Drupal\node\Entity\Node) {
      $variables['node'] = $node;
    }
  }
}


Then in page-title.html.twig:

{% if node.field_image is empty %}
  {% if title %}
    &lt;h1{{ title_attributes.addClass('page-header') }}&gt;{{ title }}&lt;/h1&gt;
  {% endif %}
{% endif %}