我在zmi页面上创建了简单的静态网站。我需要在plone首页获得python的返回值。我把tal语句放在首页/编辑并保存。但它不起作用。然后我用相同的路径检查,现在这里没有任何有关语句。 我的代码是
<div tal:define="address context/@@address-view" >
<span tal:define="li address/myaddress" >
<span tal:replace="structure python:li" />
</span>
</div>
答案 0 :(得分:5)
据我所知,你做了什么。
我猜你只是修改了Plone&#34;前页&#34; item,这是一个ATDocument。
出于安全原因,您无法直接在常规ContentType(TextField)中执行tal
。
您必须在ZMI中创建自己的ZPT视图(处理精细: - ))
http://plonesite/manage_main
index_html
(删除plone的默认首页)。同时删除已放置在新创建的页面模板中的代码。<html i18n:domain="plone"
lang="en"
metal:use-macro="here/main_template/macros/master"
xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:tal="http://xml.zope.org/namespaces/tal">
<body>
<div metal:fill-slot="main">
... YOUR CODE HERE...
</div>
</body>
</html>