Striptag 仅部分剥离
遇到了 striptags 未剥离所有标签的特殊情况。
{% if field_video|render|striptags %}
<li class="nav-item"><a data-toggle="tab" href="#product-vid">{{ field_video['#title'] }}</a></li>
{% endif %}
上面的工作是根据字段值删除“标题”,但保留边距和背景颜色。如果我使用 |trim 它会删除所有内容,但是如果字段具有“标题”值,它也会删除它。
我尝试过的其他事情: |trim 不为空
我还应该看什么?
Got a particular case of striptags not stripping all tags.
{% if field_video|render|striptags %}
<li class="nav-item"><a data-toggle="tab" href="#product-vid">{{ field_video['#title'] }}</a></li>
{% endif %}
The above works in removing the "title" according to field value, but leaves the margins and background color. If I use |trim it removes everything, however if a field has "title" value it also strips it.
Additional things I have tried:
|trim is not empty
What else should I look at?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论