1.8. Tags (up)
1.8.1. Tag 'braintree_customer_form' (up) 复制链接链接已复制到粘贴板!
呈现输入 Braintree Blue 支付网关所需数据的表单
1.8.2. Tag 'csrf' (up) 复制链接链接已复制到粘贴板!
呈现跨站点请求伪造元标签。
示例: 在 liquid 中使用 csrf 标签
<head>
{% csrf %}
</head>
<head>
{% csrf %}
</head>
1.8.3. Tag 'content' (up) 复制链接链接已复制到粘贴板!
呈现页面的正文.仅在布局内使用。
1.8.4. Tag 'content_for' (up) 复制链接链接已复制到粘贴板!
1.8.5. Tag 'debug' (up) 复制链接链接已复制到粘贴板!
将模板中所有可用的变量打印到 HTML 注释中。 我们建议从公共模板中删除此标签。
`{% debug:help %}`
`{% debug:help %}`
1.8.6. Tag 'email' (up) 复制链接链接已复制到粘贴板!
电子邮件 标签允许您自定义传出电子邮件的标头,且仅在电子邮件模板中可用。
有几个方便的子标签,如 cc 或 subject (请参见下表),但您也可以使用 header 子标签为邮件设置任意 SMTP 标头。
| 子标签 | 描述 | 示例 |
| subject | 动态主题 | {% subject = 'Greetings from Example company!' %} |
| cc | 抄送 | {% cc = 'boss@example.com' %} |
| bcc | 秘密抄送 | {% bcc = 'all@example.com' %} |
| from | 实际发送者 | {% from = 'system@example.com' %} |
| reply-to | {% reply-to = 'support@example.com' %} | |
| header | 自定义 SMTP 标头 | {% header 'X-SMTP-Group' = 'Important' %} |
| do_not_send | 丢弃电子邮件 | {% do_not_send %} |
示例: 有条件的盲复制
{% email %}
{% if plan.system_name == 'enterprise' %}
{% bcc 'marketing@world-domination.org' %}
{% endif%}
{% endemail %}
{% email %}
{% if plan.system_name == 'enterprise' %}
{% bcc 'marketing@world-domination.org' %}
{% endif%}
{% endemail %}
示例: 完全禁用电子邮件
{% email %}
{% do_not_send %}
{% endemail %}
{% email %}
{% do_not_send %}
{% endemail %}
示例: Signup email filter
1.8.7. Tag 'flash' (up) 复制链接链接已复制到粘贴板!
呈现系统的信息或错误消息.
DEPRECATED: 此标签已弃用,改为使用 FlashDrop。
示例: 在 liquid 中使用 flash 标签
{% flash %}
{% flash %}
1.8.9. Tag 'form' (up) 复制链接链接已复制到粘贴板!
根据表单的名称,呈现带有指定操作和类属性的格式标签。支持的表单有:
| 格式 | 允许的字段名称 | 垃圾邮件保护 | 备注 |
| application.create |
| 否 | |
| application.update |
| 否 | |
| signup |
| 是 |
通过添加一个或多个带有名称 |
示例: 创建应用程序的表单
1.8.10. Tag 'latest_forum_posts' (up) 复制链接链接已复制到粘贴板!
包含最新论坛文章的 HTML 表。
DEPRECATED: 使用 forum drop 替代。
示例: 使用 latest_forum_posts tag liquid
{% latest_forum_posts %}
{% latest_forum_posts %}
1.8.11. Tag 'latest_messages' (up) 复制链接链接已复制到粘贴板!
呈现包含用户最新消息的 HTML 代码片段。
示例: 使用 latest_messages tag liquid
{% latest_messages %}
{% latest_messages %}
1.8.12. Tag 'logo' (up) 复制链接链接已复制到粘贴板!
呈现徽标。
DEPRECATED: 此标签已弃用,改为使用 {{ provider.logo_url }}。
示例: 在 liquid 中使用菜单标签
{% logo %}
{% logo %}
1.8.15. Tag 'plan_widget' (up) 复制链接链接已复制到粘贴板!
包含一个用于检查或更改应用程序计划的小部件
1.8.16. Tag 'portlet' (up) 复制链接链接已复制到粘贴板!
此标签包含按系统名称的 portlet。
1.8.18. Tag '3scale_essentials' (up) 复制链接链接已复制到粘贴板!
1.8.19. Tag 'user_widget' (up) 复制链接链接已复制到粘贴板!
呈现用户小部件 html 代码段。
DEPRECATED :此标签已弃用。而是使用开发人员门户部分。
示例: 在 liquid 中使用 user_widget 标签
{% user_widget %}
<p class="notice">If you are logged in you see profile related links above.</p>
<p class="notice">If you are not login you are invited to login or signup.</p>
{% user_widget %}
<p class="notice">If you are logged in you see profile related links above.</p>
<p class="notice">If you are not login you are invited to login or signup.</p>