2016-08-03 74 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來重新加載標題配置