0

In drupal 8 how can I hide title on front page ? The title is rendered through page-title.html.twig through the code below

{% if title %}
  <h1{{ title_attributes.addClass('page-header') }}>{{ title }}</h1>
{% endif %}

I want to wrap it in if not front page condition but don't know the syntax.

  • Try with {% if is_front %} – MrD Jan 31 '18 at 9:54
4

For this you can use the is_front variable

{% if not is_front %}your code{% endif %}
4

The title is displayed in a block. Go to the block layout (/admin/structure/block), look for the block "Page Title", click on "Configure" and set the visibility on "Pages" to hide for <front>:

enter image description here

  • 1
    Wow, I didn't noticed that. Thanks for the answer, I must be using this option. – Fahad Jan 31 '18 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.