【发布时间】:2015-11-25 21:31:33
【问题描述】:
如何从 Drupal 8 的首页标题中删除“欢迎来到”
在 drupal 7 中,您只需在 page.tpl.php 中添加这部分代码:
<?php if (!$is_front){
print render($page['content']);
} ?>
【问题讨论】:
如何从 Drupal 8 的首页标题中删除“欢迎来到”
在 drupal 7 中,您只需在 page.tpl.php 中添加这部分代码:
<?php if (!$is_front){
print render($page['content']);
} ?>
【问题讨论】:
【讨论】:
<title>{% if not root_path %}{{ head_title.name }}{% else %}{{ head_title|safe_join(' | ') }}{% endif %}</title> 作为标题标签。
带有 url /node 的默认视图我们保持原样。
在 page.html.twig 中我们输出除了内容块之外的所有块:
{% 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 %}
【讨论】: