Page template Macro expansion failed

人走茶凉 提交于 2019-12-24 17:04:03

问题


I am trying to make a page template for my dexterity product using summary_view as a starting point. However customising summary view or coping the body of summary view into my type's template yeilds:

Macro expansion failed
<type 'exceptions.KeyError'>: 'standard_view'

Is there a problem with this path, or do I have to do something else to make this template available:

<metal:block use-macro="context/standard_view/macros/content-core">

回答1:


You have to add a macros method to your BrowserView.

from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile


class MyView(BrowserView):

    template = ViewPageTemplateFile('my-template.pt')

    @property
    def macros(self):
        self.template.macros


来源:https://stackoverflow.com/questions/20192834/page-template-macro-expansion-failed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!