PloneFormGen头注入示例

PloneFormGen头注入示例,plone,zope,ploneformgen,Plone,Zope,Ploneformgen,PloneFormGen允许通过所谓的标头注入将自定义数据注入网页标头。说明如下: 此覆盖字段允许您将内容插入xhtml头部。 典型的用法是添加自定义CSS或JavaScript。指定一个故事 返回字符串的表达式。插入字符串时将不带任何字符 口译。请注意:此评估中存在错误 表达式将导致窗体显示出错 我想知道这种表达的正确语法是什么。。我没有用下面的例子成功 <style type="text/css"> * { color: red !important; } </style&

PloneFormGen允许通过所谓的标头注入将自定义数据注入网页标头。说明如下:

此覆盖字段允许您将内容插入xhtml头部。 典型的用法是添加自定义CSS或JavaScript。指定一个故事 返回字符串的表达式。插入字符串时将不带任何字符 口译。请注意:此评估中存在错误 表达式将导致窗体显示出错

我想知道这种表达的正确语法是什么。。我没有用下面的例子成功

<style type="text/css"> * { color: red !important; } </style>
*{颜色:红色!重要;}

<style tal:attributes="type:text/css" tal:content="* { color: red !important; }">
<style tal:attributes="type:text/css" tal:content="string:* { color: red !important; }">
<style tal:attributes="type string:text/css" tal:content="string: * { color: red !important; }" />

<style tal:attributes="type:text/css" tal:content="* { color: red !important; }">
<style tal:attributes="type:text/css" tal:content="string:* { color: red !important; }">
<style tal:attributes="type string:text/css" tal:content="string: * { color: red !important; }" />

<style tal:attributes="type:text/css" tal:content="* { color: red !important; }">
<style tal:attributes="type:text/css" tal:content="string:* { color: red !important; }">
<style tal:attributes="type string:text/css" tal:content="string: * { color: red !important; }" />


错误消息仅通知我它有错误

该字段被解释为一个表达式;该表达式的结果将被插入。你的例子都不是故事式的表达;最后3个都使用TALES表达式作为更大TAL模板语句的一部分

在本例中,您只需要一个
字符串:
表达式即可返回静态结果:

string:<style type="text/css"> * { color: red !important; } </style>
string:{color:red!重要;}

另外,请参见在Steve上注入整个文件的示例,该链接似乎已断开。你能把它指向那个例子的新位置吗?@JoeBigler:看到了吗