首页 文章

如何使用Twig在OroCrm(Symfony2)中设置页面 Headers

提问于
浏览
0

我试图编写一个检索表的所有记录的页面 . 但我不是't know how to change title of this page, it always displays it' s url(http://localhost/crm-application/web/app_dev.php/.. . ) . 这是我的twig文件:

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

有帮助吗?非常感谢 . :)

1 回答

  • 0

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

    你的index.html.twig中还有其他任何内容吗?这可能是你遇到错误的原因 .

    要设置窗口 Headers ,您应该在bundle的Resources / config中使用navigation.yml

    oro_titles:
        orocrm_account_index: ~
    

    要么

    oro_titles:
        orocrm_account_index: 'Create Account'
    

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

相关问题