首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TAL移除每个标签

TAL移除每个标签
EN

Stack Overflow用户
提问于 2016-01-24 18:09:09
回答 2查看 121关注 0票数 1

我在金字塔框架和TAL中使用变色龙。不幸的是,TAL将每个标记移除到前两个标记。

HTML-模板:

代码语言:javascript
复制
<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>

呈现的示例:

代码语言:javascript
复制
<li>
    <input type="radio" name="discussion-button-group" onclick="location.href=&quot;http://localhost:4284/d/cat-or-dog/r/11/undermine/29&quot;" id="11">
    <label for="11">
        Because: Cats are fluffy and Cats are small
    </label>

现在我错过了“因为.”里所有的跨标签,有人知道吗,为什么?

Thx

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2016-01-25 06:34:45

在对神秘的跨度和标签标签进行了一些测试和思考之后,这将解决任何问题:

代码语言:javascript
复制
<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>&nbsp;
    </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">&nbsp;<em i18n:translate="and">and</em>&nbsp;</label>
</span>

因此,我将有一个输入标签填充标签:)

票数 0
EN

Stack Overflow用户

发布于 2016-01-25 01:19:08

我觉得你的结束语搞砸了。你不是在匹配这对。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34979457

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档