0

我是 OroCRM 和 Symfony2 的新手。我正在尝试编写一个检索表所有记录的页面。但我不知道如何更改此页面的标题,它总是显示它的 url ( http://localhost/crm-application/web/app_dev.php/.. .)。这是我的树枝文件:

{#index.html.twig#}
{% extends 'OroUIBundle:actions:index.html.twig' %}
{% import 'OroUIBundle::macros.html.twig' as UI %}

{% set gridName = 'b2b-customers-grid' %}
{% set pageTitle = 'B2B Customers' %}

我尝试了很多方法,但我做不到。我通常会得到这个错误:

A template that extends another one cannot have a body”

有什么帮助吗?非常感谢。:)

4

1 回答 1

0

pageTitle 不是您想的那个标题,据我了解,您想为整个页面设置标题、浏览器窗口标题、html 中的 head > 标题和 pageTitle 变量,它用于内容标题标题。

您的 index.html.twig 中还有其他内容吗?这可能是您出错的原因。

要设置窗口标题,您应该在包的 Resources/config 中使用 navigation.yml 类似的东西

oro_titles:
    orocrm_account_index: ~

或者

oro_titles:
    orocrm_account_index: 'Create Account'

之后不要忘记清除缓存,如果您之前没有此文件并运行 app/console oro:navigation:init 以重新加载标题配置

于 2016-08-04T07:31:51.407 回答