Zendesk Supportのプレースホルダを既にお使いいただいていれば、リキッドマークアップについて多少はご存知でしょう。リキッドマークアップとは、プレースホルダを使用可能にするためのテンプレート言語のことです。プレースホルダは自動化、マクロ、ターゲット、トリガ、およびウィジェットで、動的に生成されるチケットとユーザーデータのコンテナとして使用されます。リキッドマークアップを使用して、データが選択/表示される方法をカスタマイズできることについては、ご存じないかもしれません。リキッドでは、case文、if文、for loopなどの簡単なプログラミングロジックを作成できるからです。
マクロのコメント/説明アクションおよび自動化とトリガのメールユーザーアクションに直接簡単な制御文を記述することによって、以前は複数の自動化、マクロ、トリガで実行しなければならなかったことを1つの自動化、マクロ、トリガで実行することができます。また、コメントテキストの表示方法もカスタマイズできます。
リキッドに関するドキュメントを参照するには、Liquid for Designersをご覧ください。この言語のすべての要素が詳細に説明されています。ただし、ここでは、リキッドマークアップの機能を簡単にご紹介します。
リキッドはメールとHTMLを表示するためのテンプレート言語です。リキッドはプレースホルダを使用して、コメントとメール通知にデータを自動的に配置できるようにするメカニズムです。
- 出力:二重の中括弧内に含まれるテキストの出力です。
- タグ:プレースホルダによるデータの表示方法を決めるプログラミングロジックを含みます。
単純に出力をプレースホルダと考えれば、リキッドの機能と使い方を半分理解したようなものです。ただし、リキッド出力がチケットとユーザーデータを表示するだけでなく、テキスト文字列と配列を操作するために使用できる方法でもあることはご存じないかもしれません。リキッドでは、これらの方法は「フィルター」と呼ばれています。たとえば、フィルターを使用して、テキストを大文字に変換できます。ただし、それはフィルターの用途として最も簡単な例の1つに過ぎません。詳細については、リキッドのドキュメントを参照してください。
リキッドの使い方を理解するには、タグの機能と使い方を知る必要があります。タグは、データの選択と表示に使用できるプログラミングロジックを提供します。
リキッドタグを使用して次のプログラミング要素を作成できます。
- if else文
- case文
- for loop
- サイクル
- 変数割り当て
リキッドマークアップの使用例については、次の記事を参照してください。
65件のコメント
Hannah Lucid
Hi! Thank you so much!! I'm still having a bit of trouble so I'm going to share the full code I've been using. The code below doesn't populate anything but a “-”. I'm sure it has something to do with the {% when nil %} line, but when I try changing the statement to {% if ticket.ticket_field_option_title_XXXX = blank/nil/null/empty %} it doesn't do anything.
Any feedback/suggestions are appreciated.
0
Daniël Nieuwendijk
Can you try it with lowercase “null”:
0
Jacob the Moderator
5174506379034
Possibly…
{% if field_name != blank %}
0
Walter
Hi 5174506379034 ,
Try “nil” or “empty” instead of “NULL”
0
Hannah Lucid
Hey There,
It's me again! I was wondering if anyone knows how to use liquid markup when a text field is blank. I've tried using statements like != ‘-’ or != NULL , etc. but I'm struggling to figure it out. Is this possible? If so, how would I achieve this?
Basically, we are using webhooks to update subject lines when a specific topic is selected. I wanted to keep the double dash (TOPIC NAME - -) when the text field is blank so it will look cleaner, like (TOPIC NAME).
Thank you so much!
0
Viktor Hristovski
Is it possible to use liquid markup in zendesk on the new object type (custom objects) Thank you
0
Dylan Tragjasi
Thanks 1263169425010 - I had a feeling this was going to be the solution but for some reason preferred to bash my head against a wall for a while. This works great, thank you for the help!
1
Jacob the Moderator
Hi 4821761052186
Aside from using the end user form name, it looks like you're missing part of the form name placeholder.
Try and see if the below works for you.
{% if ticket.ticket_form == "Form 1" %}
Hello
{% elsif ticket.ticket_form == "Form 2" %}
World
{% endif %}
1
Dylan Tragjasi
Does anyone know if the ticket form object is accessible when using liquid markup? I'm trying to create a macro with different content depending on the current form selected on the ticket. I've tried many variations of the following but can't seem to get it to work:
Using the ticket.ticket_form placeholder doesn't seem to work either. Any advice? Thank you!
0
Andy F.
4453309851418 ah of course! I was overthinking this, believing I had to add the exclusion to the JSON when of course I can just add it to the main trigger. Thank you!
0
サインインしてコメントを残します。