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; }" />错误消息只告诉我它有错误。
发布于 2012-08-30 13:20:48
该字段被解释为一个故事表达式;该表达式的结果将被插入。你的例子中没有一个是童话表达式;最后的3个例子都使用了一个更大的TAL模板语句。
在您的示例中,您只需要一个string:表达式来返回一个静态结果:
string:<style type="text/css"> * { color: red !important; } </style>https://stackoverflow.com/questions/12196745
复制相似问题