
有这么一个需求,自定义一个模板标签,返回一段 html,想在这段 html 里面使用内建的或者其它自定义模板标签。该如何使用?像下面的 cycle, static 标签。在 F12 下,这些内建标签是不 work 的,求思路
html += '''<div class="{{% cycle 'replyBoxOdd' 'replyBoxEven bg2' %}}"> <div class="replyContent {{% cycle 'fltlft' 'fltrt' %}} fs14"> <span><a class="blueA commentator" href="#" data-id="{reply_id}" title="点击回复 TA 的留言">{reply_username}</a> 回复说:{reply_comment}</span> </div> <div class="replyerAvatar {{% cycle 'fltrt' 'fltlft' %}}"> <img class="ctavatar" src="{{% gravatar_url reply.email %}}" width="63" height="63" Onerror="this.src='{{% static 'site/v1/img/davatar.png' %}}'"> </div> <div class="clearfloat"></div> </div> '''.format(reply_id=item['id'], reply_username=item['username'], reply_comment=item['comment']) ```