Plone “我该怎么办?”;“经典portlet”;是否显示在页面和新闻项默认视图中?

Plone “我该怎么办?”;“经典portlet”;是否显示在页面和新闻项默认视图中?,plone,plone-4.x,Plone,Plone 4.x,我使用@@manage portlets将一个“classic portlet”与一个文件夹相关联,我希望此文件夹下的所有NewsItem和Pages项目也会显示此portlet。但我收到了一个错误“呈现portlet时出错”。以下是回溯: 2015-06-26 13:52:35 ERROR Zope.SiteErrorLog 1435337555.110.623795385389 http://localhost:8080/institucional/datasenado/research/a

我使用
@@manage portlets
将一个“classic portlet”与一个文件夹相关联,我希望此文件夹下的所有NewsItem和Pages项目也会显示此portlet。但我收到了一个错误“呈现portlet时出错”。以下是回溯:

2015-06-26 13:52:35 ERROR Zope.SiteErrorLog 1435337555.110.623795385389 http://localhost:8080/institucional/datasenado/research/a-test-research-newitem/newsitem_view
Traceback (innermost last):
  Module plone.app.portlets.manager, line 61, in safe_render
  Module Products.Five.browser.pagetemplatefile, line 125, in __call__
  Module Products.Five.browser.pagetemplatefile, line 59, in __call__
  Module zope.pagetemplate.pagetemplate, line 113, in pt_render
   - Warning: Macro expansion failed
   - Warning: <type 'exceptions.NameError'>: name 'path_expression' is not     defined
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 852, in do_condition
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 533, in do_optTag_tal
  Module zope.tal.talinterpreter, line 518, in do_optTag
  Module zope.tal.talinterpreter, line 513, in no_tag
  Module zope.tal.talinterpreter, line 343, in interpret
  Module zope.tal.talinterpreter, line 867, in do_useMacro
  Module zope.tales.tales, line 696, in evaluate
   - URL: /plone4/buildout-cache/eggs/plone.app.portlets-2.1.5-py2.6.egg/plone/app/portlets/portlets/classic.pt
   - Line 6, Column 4
   - Expression: <PythonExpr (path(path_expression))>
   - Names:
      {'args': (),
       'container': <ATNewsItem at /institucional/datasenado/research/a-test-research-newitem>,
       'context': <ATNewsItem at /institucional/datasenado/research/a-test-research-newitem>,
       'default': <object object at 0xb77147d0>,
       'here': <ATNewsItem at /institucional/datasenado/research/a-test-research-newitem>,
       'loop': {},
       'nothing': None,
       'options': {},
       'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 0xccffaa4>,
       'request': <HTTPRequest, URL=http://localhost:8080/institucional/datasenado/research/a-test-research-newitem/newsitem_view>,
       'root': <Application at >,
       'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0xdc7a4cc>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'admin'>,
       'view': <plone.app.portlets.portlets.classic.Renderer object at 0xe06794c>,
       'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 0xe0673cc>}
  Module zope.tales.pythonexpr, line 59, in __call__
   - __traceback_info__: (path(path_expression))
  Module <string>, line 1, in <module>
  Module zope.tales.pythonexpr, line 77, in __call__
  Module zope.tales.expressions, line 217, in __call__
  Module Products.PageTemplates.Expressions, line 147, in _eval
  Module zope.tales.expressions, line 124, in _eval
  Module Products.PageTemplates.Expressions, line 94, in trustedBoboAwareZopeTraverse
  Module OFS.Traversable, line 283, in unrestrictedTraverse
   - __traceback_info__: ([], 'menudatasenado')
AttributeError: menudatasenado
2015-06-26 13:52:35错误Zope.SiteErrorLog 143537555.110.623795385389http://localhost:8080/institucional/datasenado/research/a-测试研究newitem/newitem\u视图
回溯(最里面的最后一个):
模块plone.app.portlets.manager,第61行,安全渲染
模块Products.Five.browser.pagetemplatefile,第125行,在调用中__
模块Products.Five.browser.pagetemplatefile,第59行,在调用中__
模块zope.pagetemplate.pagetemplate,第113行,在pt_渲染中
-警告:宏扩展失败
-警告::未定义名称“路径\表达式”
模块zope.tal.t interpreter,第271行,输入调用__
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
模块zope.tal.t第852行的interpreter处于do_状态
模块zope.tal.t解释程序第343行
do_optTag_tal中模块zope.tal.tInterpreter,第533行
do_optTag中第518行模块zope.tal.tInterpreter
模块zope.tal.tInterpreter,第513行,无标签
模块zope.tal.t解释程序第343行
do_useMacro中第867行模块zope.tal.t interpreter
模块zope.tales.tales,第696行,在评估中
-URL:/plone4/buildout cache/eggs/plone.app.portlets-2.1.5-py2.6.egg/plone/app/portlets/portlets/classic.pt
-第6行第4栏
-表达方式:
-姓名:
{'args':(),
“容器”:,
“上下文”:,
“默认值”:,
“这里”:,
'循环':{},
“没有”:没有,
“选项”:{},
“重复”:,
“请求”:,
“根”:,
“模板”:,
“遍历子路径”:[],
“用户”:,
“视图”:,
“视图”:
模块zope.tales.pythonexpr,第59行,呼叫__
-__回溯_信息__:(路径(路径表达式))
模块,第1行,输入
模块zope.tales.pythonexpr,第77行,输入调用__
模块zope.tales.expressions,第217行,输入调用__
模块Products.PageTemplates.Expressions,第147行,评估中
模块zope.tales.expressions,第124行,评估
模块Products.PageTemplates.Expressions,第94行,在TrustedBoboawareZopeTravel中
可穿越模块,第283行,无限制行程
-_uuu回溯_uu信息:([],“menudatasenado”)
属性错误:menudatasenado

那么,如何在页面和新闻项默认视图中显示“classic portlet”呢?

您的理解是正确的:如果在文件夹中设置portlet,它也将显示在该文件夹或其任何子文件夹中的任何项目上(除非您明确阻止portlet)

在您描述的示例中,portlet呈现中有一个错误:您需要理解为什么为
menudatasenado
获取
AttributeError


如果没有portlet代码,很难为您提供更多帮助。您似乎引用了其他内容项无法访问的特定内容项(
menudatasenado
)。

您的理解是正确的:如果在文件夹上设置portlet,它也将显示在该文件夹或其任何子文件夹中的任何项上(除非您明确阻止portlet)

在您描述的示例中,portlet呈现中有一个错误:您需要理解为什么为
menudatasenado
获取
AttributeError


如果没有portlet代码,很难为您提供更多帮助。您似乎引用了其他内容项无法访问的特定内容项(
menudatasenado
)。

您的理解是正确的:如果在文件夹上设置portlet,它也将显示在该文件夹或其任何子文件夹中的任何项上(除非您明确阻止portlet)

在您描述的示例中,portlet呈现中有一个错误:您需要理解为什么为
menudatasenado
获取
AttributeError


如果没有portlet代码,很难为您提供更多帮助。您似乎引用了其他内容项无法访问的特定内容项(
menudatasenado
)。

您的理解是正确的:如果在文件夹上设置portlet,它也将显示在该文件夹或其任何子文件夹中的任何项上(除非您明确阻止portlet)

在您描述的示例中,portlet呈现中有一个错误:您需要理解为什么为
menudatasenado
获取
AttributeError


如果没有portlet代码,很难为您提供更多帮助。您似乎引用了一个特定的内容项(
menudatasenado
),该内容项无法从其他内容项访问。

仅此而已,Godefroid Chapelle。MenuDatasenado是一个带有
grok.context(IFolder)
的grok视图。我把它改成了
grok.context(Interface)
,看起来很管用。谢谢就这样,戈德弗里德·查佩尔。MenuDatasenado是一个带有
grok.context(IFolder)
的grok视图。我把它改成了
grok.context(Interface)
,看起来很管用。谢谢就这样,戈德弗里德·查佩尔。MenuDatasenado是一个带有
grok.context(IFolder)
的grok视图。我把它改成了
grok.context(Interface)
,看起来很管用。谢谢就这样,戈德弗里德·查佩尔。MenuDatasenado是一个带有
grok.context(IFolder)
的grok视图。我把它改成了
grok.context(Interface)
,看起来很管用。谢谢