我在金字塔框架和TAL中使用变色龙。不幸的是,TAL将每个标记移除到前两个标记。
HTML-模板:
<label tal:attributes="for item.id">
<span i18n:translate="Because:" tal:condition="item.leading_because">Because:</span>
<span tal:repeat="premise item.premises" tal:attributes="for item.id; id premise.id">
<span tal:attributes="for item.id; id premise.id" tal:content="premise.title">premise</span>
<span tal:condition="not:repeat.premise.end">
<i><span i18n:translate="and"> and </span></i>
</span>
</span>
</label>呈现的示例:
<li>
<input type="radio" name="discussion-button-group" onclick="location.href="http://localhost:4284/d/cat-or-dog/r/11/undermine/29"" id="11">
<label for="11">
Because: Cats are fluffy and Cats are small
</label>
现在我错过了“因为.”里所有的跨标签,有人知道吗,为什么?
Thx
发布于 2016-01-25 06:34:45
在对神秘的跨度和标签标签进行了一些测试和思考之后,这将解决任何问题:
<li tal:repeat="item items">
<input type="radio" name="discussion-button-group" onclick="" tal:attributes="id item.id; onclick item.url">
<label tal:attributes="for item.id" tal:condition="item.leading_because">
<span tal:omit-tag="" tal:attributes="for item.id" i18n:translate="Because:">Because:</span>
</label>
<span tal:repeat="premise item.premises" tal:omit-tag="">
<label tal:attributes="for item.id; id premise.id" tal:content="premise.title">premise</label>
<label tal:condition="not:repeat.premise.end"> <em i18n:translate="and">and</em> </label>
</span>
因此,我将有一个输入标签填充标签:)
发布于 2016-01-25 01:19:08
我觉得你的结束语搞砸了。你不是在匹配这对。
https://stackoverflow.com/questions/34979457
复制相似问题