我可以直接在重氮规则中测试Plone页面的存在吗?

我可以直接在重氮规则中测试Plone页面的存在吗?,plone,diazo,Plone,Diazo,我已经编写了一个重氮规则,允许用户通过编辑网站内的特定页面来定制Plone网站的页脚。以下规则符合我的要求: <replace css:theme-children="#portal-footer" css:content-children="#content-core" href="/theme_resources/footer" if="$footer_id = 'footer'" /> 如果我不包括该条件,当用户删除或移动/theme\u resources/fo

我已经编写了一个重氮规则,允许用户通过编辑网站内的特定页面来定制Plone网站的页脚。以下规则符合我的要求:

<replace css:theme-children="#portal-footer"
  css:content-children="#content-core"
  href="/theme_resources/footer"
  if="$footer_id = 'footer'" />
如果我不包括该条件,当用户删除或移动/theme\u resources/footer时,我会得到以下回溯,并且根本不会应用该主题:

2013-05-28 10:46:55 ERROR plone.subrequest Error handling subrequest to /theme_resources/footer
Traceback (most recent call last):
  File "c:\plone43\eggs\plone.subrequest-1.6.7-py2.7.egg\plone\subrequest\__init__.py", line 116, in subrequest
    traversed = request.traverse(path)
  File "c:\plone43\eggs\zope2-2.13.19-py2.7.egg\ZPublisher\BaseRequest.py", line 518, in traverse
    return response.notFoundError(URL)
  File "c:\plone43\eggs\zope2-2.13.19-py2.7.egg\ZPublisher\HTTPResponse.py", line 718, in notFoundError
当我包含条件时,如果用户删除参数表达式,主题将中断


我可以在规则上使用不同的条件直接测试页面是否存在,而不使用变量吗?

您不能直接使用Diazo测试任意内容对象是否存在

如果你的问题是当条件评估为false时主题在视觉上被破坏,那么你可以使用另一个与条件完全相反的规则,这样你就可以在重氮层中有一个动态的回退。不过,在本例中,我只需在HTML中添加一个静态回退页脚,以便在未应用规则时使用它


另一方面,如果你的意思是在删除页脚页面时,你的主题根本没有被应用,请发布一个回溯。

实现相同目的的另一种方法(可编辑的页脚):创建一个静态文本portlet来包含页脚,并使用重氮规则将其移动到页脚位置。我添加了回溯,我澄清说,主题突破意味着它根本不适用。
2013-05-28 10:46:55 ERROR plone.subrequest Error handling subrequest to /theme_resources/footer
Traceback (most recent call last):
  File "c:\plone43\eggs\plone.subrequest-1.6.7-py2.7.egg\plone\subrequest\__init__.py", line 116, in subrequest
    traversed = request.traverse(path)
  File "c:\plone43\eggs\zope2-2.13.19-py2.7.egg\ZPublisher\BaseRequest.py", line 518, in traverse
    return response.notFoundError(URL)
  File "c:\plone43\eggs\zope2-2.13.19-py2.7.egg\ZPublisher\HTTPResponse.py", line 718, in notFoundError