> ## Documentation Index
> Fetch the complete documentation index at: https://foliant-help.iforiti.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Liquidフィルター

> Foliantが追加するLiquidフィルター(金額、日付、文言、住所、画像、バーコード、数値、色)の一覧です。

フィルターは、値の印刷のされ方を変えます。値の後にパイプを付けて追加します: `{{ total_price | money }}`。複数をつなげることもできます: `{{ note | escape | newline_to_br }}`。FoliantはLiquidの標準フィルター(`escape`、`default`、`upcase`、`date`、`plus`、`minus`、`split`、`join`、`newline_to_br` など)に対応しており、さらに以下のフィルターを追加しています。

## 金額

| フィルター | 例 | 機能 |
| - | - | - |
| `money` | `{{ total_price \| money }}` | セント単位の金額を注文の通貨で表示します |
| `money_with_currency` | `{{ total_price \| money_with_currency }}` | 同じ内容を通貨コード付きで表示します(`$1.00 USD`) |
| `money_without_currency` | `{{ total_price \| money_without_currency }}` | 数値のみを表示します(`1.00`) |
| `money_without_trailing_zeros` | `{{ 10000 \| money_without_trailing_zeros }}` | `.00` を省きます(`$100`) |
| `money_in` | `{{ amount \| money_in: 'EUR' }}` | 指定した通貨で金額を表示します |

[テンプレートでの金額と通貨](https://foliant-help.iforiti.com/jp/template-editor/liquid-money-and-currency.md)をご覧ください。

## 日付と文言

| フィルター | 例 | 機能 |
| - | - | - |
| `date` | `{{ created_at \| date: '%d %B %Y' }}` | 日付を書式設定します。月名や曜日名はドキュメントの言語で表示されます。言語を指定して上書きすることもできます: `date: '%B', customer_locale`。 |
| `t`(`translate`、`label` も可) | `{{ 'subtotal' \| t }}` | Foliantの文言をドキュメントの言語で表示します |
| `t_both` | `{{ 'titles.invoice' \| t_both }}` | 文言をドキュメントの言語と第2言語の両方で表示します(「Rechnung / Invoice」) |
| `labelled` | `{{ shop.vat_number \| labelled: 'vat_number', ' · ' }}` | 値をラベルの後に表示します(「 · VAT number NL…」)。値が空の場合は何も表示しません |

[日付、言語、翻訳](https://foliant-help.iforiti.com/jp/template-editor/liquid-dates-and-languages.md)をご覧ください。

## 住所、画像、リンク

| フィルター | 例 | 機能 |
| - | - | - |
| `format_address` | `{{ shipping_address \| format_address }}` | Shopifyと同じように、住所を複数行に整えて表示します |
| `img_url` | `{{ line_item.image \| img_url: '120x120' }}` | Shopifyの画像を指定サイズで表示します: `'thumb'`、`'small'`、`'medium'`、`'large'`、または `'120x120'` |
| `img_tag` | `{{ line_item.image \| img_url: 'thumb' \| img_tag }}` | 画像アドレスから `<img>` タグを作成します。代替テキストとクラスは任意で指定できます: `img_tag: 'Logo', 'logo'` |
| `link_to` | `{{ 'Track your order' \| link_to: order_status_url }}` | リンクを作成します |

## バーコードとQRコード

| フィルター | 例 | 機能 |
| - | - | - |
| `barcode` | `{{ line_item.sku \| barcode }}` | バーコードを表示します(種類を指定しない場合はCode 128。`'ean13'` などを指定できます) |
| `qr` | `{{ order_status_url \| qr }}` | QRコードを表示します |

[バーコードとQRコード](https://foliant-help.iforiti.com/jp/template-editor/liquid-barcodes-and-qr-codes.md)をご覧ください。

## 数値とテキスト

| フィルター | 例 | 機能 |
| - | - | - |
| `weight_with_unit` | `{{ line_item.grams \| weight_with_unit }}` | グラム単位の重量を単位付きで表示します。1,000 g未満はグラム、それ以上はキログラムで表示します。単位を指定すると換算します: `weight_with_unit: 'lb'`(`kg`、`g`、`lb`、`oz`) |
| `format_number` | `{{ 1234.5 \| format_number: 2 }}` | ドキュメントの言語の区切り記号で数値を表示します(ドイツ語では `1.234,50`) |
| `number_with_precision` | `{{ 1.2345 \| number_with_precision: 2 }}` | 指定した小数点以下の桁数で数値を表示します(`1.23`) |
| `pluralize` | `{{ item_count \| pluralize: 'item', 'items' }}` | 数に応じて単数形または複数形の語を表示します |
| `handleize` | `{{ 'Hello World!' \| handleize }}` | `hello-world` |
| `strip_html` | `{{ product.description \| strip_html }}` | HTMLタグを取り除きます |
| `truncate_words` | `{{ product.description \| truncate_words: 20 }}` | テキストを指定した単語数に短縮します |
| `default_value` | `{{ po_number \| default_value: 'N/A' }}` | 値が空の場合の代替値を表示します |
| `json` | `{{ shipping_address \| json }}` | 値をデータとして表示します。テンプレート作成中に中身を確認する際に便利です |

## 色

| フィルター | 例 | 機能 |
| - | - | - |
| `color_mix` | `{{ shop_accent_color \| color_mix: '#ffffff', 20 }}` | 2つの色を混ぜます: 1つ目の色が20%になります |
| `color_contrast` | `{{ shop_accent_color \| color_contrast: '#ffffff' }}` | 2つの色のコントラスト比(1–21)を表示します |

## スニペット

標準的なVATセクションを印刷する組み込みスニペットが2つあります:

* `{% include 'vat_breakdown' %}`: 税率ごとのVAT内訳表です。
* `{% include 'legal_notes' %}`: VATの法定注記です(リバースチャージ、輸出、IOSSなど)。

[税金と法的事項](https://foliant-help.iforiti.com/jp/tax-and-legal.md)をご覧ください。

## 補足

* コードエディターは、認識できないフィルターに警告を表示します。警告が表示されたら、プレビューを確認してください。
* Shopifyのストアフロントテーマで使えるフィルターの中には、ドキュメントでは使えないものがあります。上記のフィルターとLiquidの標準フィルターをご利用ください。

## 関連記事

* [テンプレートでの金額と通貨](https://foliant-help.iforiti.com/jp/template-editor/liquid-money-and-currency.md)
* [日付、言語、翻訳](https://foliant-help.iforiti.com/jp/template-editor/liquid-dates-and-languages.md)
* [バーコードとQRコード](https://foliant-help.iforiti.com/jp/template-editor/liquid-barcodes-and-qr-codes.md)
* [orderオブジェクトとよく使う変数](https://foliant-help.iforiti.com/jp/template-editor/liquid-order-variables.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.