---
title: Theme block targeting
description: Learn how to target theme blocks
source_url:
  html: >-
    https://shopify.dev/docs/storefronts/themes/architecture/blocks/theme-blocks/targeting
  md: >-
    https://shopify.dev/docs/storefronts/themes/architecture/blocks/theme-blocks/targeting.md
api_name: liquid
---

# Theme block targeting

Theme block targeting allows theme developers to specify which blocks can be used in a section. In a theme section, theme developers can choose to:

1. Accept all theme blocks for use
2. Accept specific theme blocks for use

***

## Accept all theme blocks

To accept all theme blocks in a section by adding a generic entry of type `@theme` to the [blocks attribute](https://shopify.dev/docs/storefronts/themes/architecture/sections/section-schema#blocks) of the [schema](https://shopify.dev/docs/storefronts/themes/architecture/sections/section-schema) of that section. To be more restrictive about which blocks can be use in specific sections, use [block targeting](https://shopify.dev/docs/storefronts/themes/architecture/blocks/theme-blocks/targeting).

In the following example, the Section will have access to all theme blocks.

## /sections/section.liquid

```liquid
{% content_for 'blocks' %}


{% schema %}
{
  "name": "Section",
  "blocks": [{"type": "@theme"}]
}
{% endschema %}
```

***

## Accept specific theme blocks

To accept specific theme blocks, theme developers can explicitly reference blocks in their schema. In the following example, the Slideshow section has access to only the Slide theme block, so the block picker for Slideshow contains a single block: slide.

A theme block appears in the block picker only if it defines [`presets`](https://shopify.dev/docs/storefronts/themes/architecture/blocks/theme-blocks/schema#presets). By default, a theme block that defines presets is available in all sections and theme blocks, so the slide block below appears in the block picker for every section, not just the slideshow section.

## /blocks/slide.liquid

```liquid
{% content_for 'blocks' %}


{% schema %}
{
  "name": "Slide",
  "presets": [{"name": "Slide"}]
}
{% endschema %}
```

## /sections/slideshow\.liquid

```liquid
{% content_for 'blocks' %}


{% schema %}
{
  "name": "Slideshow",
  "blocks": [{"type": "slide"}]
}
{% endschema %}
```

***

## Private blocks

There are cases where you might want to limit the blocks that are available in sections. For example, slides are a type of block that should only be available in slideshow sections. To prevent the default behavior, theme developers can name the block with an underscore prefix.

In this case, `slide.liquid` can be renamed to `_slide.liquid`. All underscore prefixed blocks would be excluded from appearing in the block picker for blocks and sections that accept blocks with type `@theme`. Those blocks and sections will need to explicitly add the block by base filename. Ex: `"blocks": [ { "type": "_slide" } ]`

## /blocks/\_slide.liquid

```liquid
{% schema %}
{
  "name": "Slide",
  "presets": [{"name": "Slide"}]
}
{% endschema %}
```

## /sections/slideshow\.liquid

```liquid
{% content_for 'blocks' %}


{% schema %}
{
  "name": "Slideshow",
  "blocks": [{"type": "_slide"}]
}
{% endschema %}
```

***
