Remove Welcome to in Drupal 8
Asked Answered
S

2

6

How to remove "Welcome to" from header title on front page in Drupal 8

enter image description here

In drupal 7 you just add in page.tpl.php this part of code:

<?php if (!$is_front){
print render($page['content']);
} ?>
Soupy answered 25/11, 2015 at 21:31 Comment(0)
C
13

In D8 frontpage is a view. To change title of the front page, go to admin/structure/views/view/frontpage, find Global: Title override link

enter image description here

Open it and it will allow to set or remove custom front page title.

Cordovan answered 26/11, 2015 at 6:7 Comment(2)
Is it possible to make this text translatable?Archon
For me, when removing the Title override setting the word Home appears before the site name. Ex. "Home | Dr Taifi". If you want to use only the site name as the front page tile you can modify the html.html.twig for your theme and use <title>{% if not root_path %}{{ head_title.name }}{% else %}{{ head_title|safe_join(' | ') }}{% endif %}</title> for the title tag.Lovins
L
0

Default views with url /node we leave as it is.

In page.html.twig we output all blocks except content block:

{% if is_front %}
  {{ page.content.breadcrumbs }}
  {{ page.content.page_title }}
  {{ page.content.local_tasks }}
  {{ page.content.help }}
  {{ page.content.local_actions }}
  {#{{ page.content.content }}#} < no content
{% else %}
  {{ page.content }}
{% endif %}

page-title.html.twig

{% if title %}
    {# nothing #}
{% else %}  {# for other pages #}
    <h1{{ title_attributes.addClass('page-header') }}>{{ title }}</h1>
{% endif %}
Lorelle answered 12/11, 2020 at 20:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.