2016-08-03 80 views
0

我是OroCRM和Symfony2中的新成员。我试图编写一个检索表的所有记录的页面。但我不知道如何更改此页面的标题,它始终显示它的网址(http://localhost/crm-application/web/app_dev.php/..。)。 这是我的枝杈文件:如何使用树枝在OroCrm(Symfony2)中设置页面标题

{#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” 

任何帮助吗?非常感谢。 :)

回答

0

pageTitle不是你想到的那个标题,因为我知道你想为整个页面设置标题,浏览器窗口标题,head> html标题,pageTitle变量是内容标题标题。

您的index.html.twig中是否有其他内容?这可能是你得到错误的原因。

要设置窗口的标题,你应该在你的包的资源使用navigation.yml/config中的东西,如

oro_titles: 
    orocrm_account_index: ~ 

oro_titles: 
    orocrm_account_index: 'Create Account' 

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