---
title: ValidContentForArgumentTypes
description: >-
  Ensures arguments passed to static blocks match the expected types defined in
  LiquidDoc.
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-content-for-argument-types
  md: >-
    https://shopify.dev/docs/storefronts/themes/tools/theme-check/checks/valid-content-for-argument-types.md
api_name: liquid
---

# Valid​Content​For​Argument​Types

All arguments provided when rendering a static block must match the respective parameter's type defined in that block's [LiquidDoc](https://shopify.dev/docs/storefronts/themes/tools/liquid-doc). If the argument is a variable this check will always pass.

***

## Examples

The following examples contain code snippets that either fail or pass this check. All examples refer to the following block with optional parameters.

## blocks/example-block.liquid

```liquid
{% doc %}
  @param {string} [some_str]
  @param {number} [some_num]
  @param {boolean} [some_bool]
  @param {object} [some_obj]
  @param [some_untyped]
{% enddoc %}
```

### ✗ Fail

In the following example, the static block is being rendered with an incorrect type:

## sections/section.liquid

```liquid
{% content_for 'block', type: 'example-block', some_str: 1 %}
```

### ✓ Pass

In the following example, all arguments passed into the static block match the expected type:

## sections/section.liquid

```liquid
{% content_for 'block',
  type: 'example-block',
  some_str: 'text',
  some_num: 1,
  some_bool: false,
  some_obj: shop,
  some_untyped: product
%}
```

NOTE: `shop` and `product` are global Liquid variables

### ✓ Pass

In the following example, an object is passed as a boolean argument since all Liquid objects can be truthy/falsey:

## sections/section.liquid

```liquid
{% content_for 'block', type: 'example-block', some_bool: product %}
```

### ✓ Pass

In the following example, a variable is passed as an argument, which will always pass this check:

## sections/section.liquid

```liquid
{% assign some_var = 'text' %}
{% content_for 'block',
  type: 'example-block',
  some_str: some_var,
  some_num: some_var,
  some_bool: some_var,
  some_obj: some_var,
  some_untyped: some_var
%}
```

***

## Options

The following example contains the default configuration for this check:

```yaml
ValidContentForArgumentTypes:
enabled: true
severity: warning
```

| Parameter | Description |
| - | - |
| `enabled` | Whether this check is enabled. |
| `severity` | The [severity](https://shopify.dev/docs/storefronts/themes/tools/theme-check/configuration#check-severity) of the check. |

***

## Disabling this check

Disabling this check isn't recommended.

***
