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>
Copy to Clipboard Toggle word wrap

1.8.3. Tag 'content' (up)

呈现页面的正文.仅在布局内使用。

1.8.4. Tag 'content_for' (up)

1.8.5. Tag 'debug' (up)

将模板中所有可用的变量打印到 HTML 注释中。 我们建议从公共模板中删除此标签

`{% debug:help %}`
Copy to Clipboard Toggle word wrap

1.8.6. Tag 'email' (up)

电子邮件 标签允许您自定义传出电子邮件的标头,且仅在电子邮件模板中可用。

有几个方便的子标签,如 ccsubject (请参见下表),但您也可以使用 header 子标签为邮件设置任意 SMTP 标头。

Expand

子标签

描述

示例

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 %}
Copy to Clipboard Toggle word wrap

示例: 完全禁用电子邮件

{% email %}
  {% do_not_send %}
{% endemail %}
Copy to Clipboard Toggle word wrap

示例: Signup email filter

{% email %}
  {% if plan.system == 'enterprise' %}
    {% subject = 'Greetings from Example company!' %}
    {% reply-to = 'support@example.com' %}
  {% else %}
    {% do_not_send %}
  {% endif %}
{% endemail %}
Copy to Clipboard Toggle word wrap

1.8.7. Tag 'flash' (up)

呈现系统的信息或错误消息.

DEPRECATED: 此标签已弃用,改为使用 FlashDrop。

示例: 在 liquid 中使用 flash 标签

   {% flash %}
Copy to Clipboard Toggle word wrap

1.8.9. Tag 'form' (up)

根据表单的名称,呈现带有指定操作和类属性的格式标签。支持的表单有:

Expand

格式

允许的字段名称

垃圾邮件保护

备注

application.create

  • application[name]
  • application[description]
  • application[<any-extra-field>]

 

application.update

  • application[name]
  • application[description]
  • application[<any-extra-field>]

 

signup

  • account[org_name]
  • account[org_legaladdress]
  • account[org_legaladdress_cont]
  • account[city]
  • account[state]
  • account[zip]
  • account[telephone_number]
  • account[country_id]
  • account[<any-extra-field>]
  • account[user][username]
  • account[user][email]
  • account[user][first_name]
  • account[user][last_name]
  • account[user][password]
  • account[user][password_confirmation]
  • account[user][title]
  • account[user][<any-extra-field>]

通过添加一个或多个带有名称 plan_ids[] 的隐藏字段,直接登录到您选择的计划。如果在当前 URL 中找到此类名称的参数,则会自动填充输入字段。

示例: 创建应用程序的表单

{% form 'application.create', application %}


   {{ application.errors.name | inline_errors }}


{% endform %}
Copy to Clipboard Toggle word wrap

1.8.10. Tag 'latest_forum_posts' (up)

包含最新论坛文章的 HTML 表。

DEPRECATED: 使用 forum drop 替代。

示例: 使用 latest_forum_posts tag liquid

{% latest_forum_posts %}
Copy to Clipboard Toggle word wrap

1.8.11. Tag 'latest_messages' (up)

呈现包含用户最新消息的 HTML 代码片段。

示例: 使用 latest_messages tag liquid

{% latest_messages %}
Copy to Clipboard Toggle word wrap

1.8.13. Tag 'menu' (up)

DEPRECATED: 此标签已弃用,改为使用 '{% include "menu" %}'。

1.8.14. Tag 'oldfooter' (up)

呈现页脚 html 代码片段.

DEPRECATED :此标签已弃用。而是使用开发人员门户部分。

1.8.15. Tag 'plan_widget' (up)

包含一个用于检查或更改应用程序计划的小部件

{% if application.can_change_plan? %}
  <a href="#choose-plan-{{ application.id }}"
     id="choose-plan-{{application.id}}">
    Review/Change
  </a>
  {% plan_widget application %}
{% endif %}
Copy to Clipboard Toggle word wrap

1.8.16. Tag 'portlet' (up)

此标签包含按系统名称的 portlet。

1.8.17. Tag 'submenu' (up)

为登录的用户呈现子菜单 html 代码片段.

DEPRECATED: 此标签已弃用,改为使用 'submenu' 部分

示例: 在 liquid 中使用 submenu 标签

   {% submenu %}
Copy to Clipboard Toggle word wrap

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>
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat