# View matcher reference

You can use the following matchers to [match content views](https://doc.ibexa.co/en/latest/templating/templates/template_configuration/#view-rules-and-matching):

| Identifier                                                     | Matches                                                                              |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| [`Id\Content`](#idcontent)                                     | ID number of the content item.                                                       |
| [`Id\ContentType`](#idcontenttype)                             | ID number of the content type that the content item belongs to.                      |
| [`Identifier\ContentType`](#identifiercontenttype)             | Identifier of the content type that the content item belongs to.                     |
| [`Id\ContentTypeGroup`](#idcontenttypegroup)                   | ID number of the group containing the content type that the content item belongs to. |
| [`Id\Location`](#idlocation)                                   | ID number of a Location.                                                             |
| [`Id\LocationRemote`](#idlocationremote)                       | Remote ID number of a Location.                                                      |
| [`Id\ParentContentType`](#idparentcontenttype)                 | ID number of the parent content type.                                                |
| [`Identifier\ParentContentType`](#identifierparentcontenttype) | Identifier of the parent content type.                                               |
| [`Id\ParentLocation`](#idparentlocation)                       | ID number of the parent Location.                                                    |
| [`Id\Remote`](#idremote)                                       | Remote ID of a content item.                                                         |
| [`Id\Section`](#idsection)                                     | ID number of the Section that the content item belongs to.                           |
| [`Identifier\Section`](#identifiersection)                     | Identifier of the Section that the content item belongs to.                          |
| [`Depth`](#depth)                                              | Depth of the Location. The depth of a top level Location is 1.                       |
| [`UrlAlias`](#urlalias)                                        | Virtual URL of the Location.                                                         |
| [Product attribute value](#product-attribute-value)            | Value of product attributes.                                                         |
| [Product code](#product-code)                                  | Product code.                                                                        |
| [Product type](#product-type)                                  | Product type.                                                                        |
| [Product availability](#product-availability)                  | Product availability.                                                                |
| [Product](#product)                                            | Whether the object is a product.                                                     |
| [Product catalog root](#product-catalog-root)                  | Whether the Location is the root of a product catalog.                               |
| [Taxonomy entry ID](#taxonomy-entry-id)                        | ID of taxonomy entry.                                                                |
| [Taxonomy entry identifier](#taxonomy-entry-identifier)        | Identifier of taxonomy entry.                                                        |
| [Taxonomy entry level](#taxonomy-entry-level)                  | Level of taxonomy entry.                                                             |
| [Taxonomy type](#taxonomy-type)                                | Taxonomy type.                                                                       |

Tip

Each matcher has a scalar value or an array of scalar values. When an array is passed, it matches on one of its values.

You can also create [custom view matchers](https://doc.ibexa.co/en/latest/templating/templates/create_custom_view_matcher/index.md).

## Id\\Content

Matches the ID number of a content item.

```
match:
    Id\Content: 145
```

## Id\\ContentType

Matches the ID number of a content type that the content item belongs to.

```
match:
    Id\ContentType: 2
```

## Identifier\\ContentType

Matches the identifier of the content type that the content item belongs to.

```
match:
    Identifier\ContentType: [blog_post]
```

## Id\\ContentTypeGroup

Matches the ID number of the content type Group that the content item belongs to.

```
match:
    Id\ContentTypeGroup: 1
```

## Id\\Location

Matches the ID number of a location. In the case of a content item, matched against the main location.

```
match:
    Id\Location: 144
```

## Id\\LocationRemote

Matches the Remote ID number of a location. In the case of a content item, matched against the main location.

```
match:
    Id\LocationRemote: 5b1e33529082b68ad3a41b9089136a0a
```

## Id\\ParentContentType

Matches the ID number of the parent content type. In the case of a content item, matched against the main location.

```
match:
    Id\ParentContentType: 42
```

## Identifier\\ParentContentType

Matches the identifier of the parent content type. In the case of a content item, matched against the main location.

```
match:
    Identifier\ParentContentType: blog
```

## Id\\ParentLocation

Matches the ID number of the parent location. In the case of a content item, matched against the main location.

```
match:
    Id\ParentLocation: 2
```

## Id\\Remote

Matches the remote ID number of a content item.

```
match:
    Id\Remote: 145
```

## Id\\Section

Matches the ID number of the section that the content item belongs to.

```
match:
    Id\Section: 1
```

## Identifier\\Section

Matches the identifier of the section that the content item belongs to.

```
match:
    Identifier\Section: standard
```

## Depth

Matches the depth of the location. The depth of a top level location is 1.

```
match:
    Depth: 2
```

## UrlAlias

Matches the virtual URL of the location. Matches when the URL alias of the location starts with the value passed.

```
match:
    UrlAlias: 'terms-and-conditions'
```

## Product attribute value

`Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\AttributeValue` matches the value of product attributes.

```
match:
    '@Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\AttributeValue': { width: 20, height: 10 }
```

## Product code

`Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\ProductCode` matches the product code.

```
match:
    '@Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\ProductCode': ['DRE1536SF']
```

## Product type

`Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\ProductType` matches the product type.

```
match:
    '@Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\ProductType': ['dress']
```

## Product availability

`Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\IsAvailable` matches the availability of a product. Refers to the existence of availability, not to whether the product is in stock.

```
match:
    '@Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\IsAvailable': true
```

## Product

`Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\IsProduct` matches when the object is a product.

```
match:
    '@Ibexa\Contracts\ProductCatalog\ViewMatcher\ProductBased\IsProduct': ~
```

## Product catalog root

`Ibexa\Contracts\ProductCatalog\ViewMatcher\LocationBased\RootLocation` matches depending on whether the location is the root of a product catalog.

```
match:
    '@Ibexa\Contracts\ProductCatalog\ViewMatcher\LocationBased\RootLocation': true
```

## Taxonomy entry ID

`Ibexa\Taxonomy\View\Matcher\TaxonomyEntryBased\Id` matches based on an ID of the taxonomy entry.

```
match:
    '@Ibexa\Taxonomy\View\Matcher\TaxonomyEntryBased\Id': [1, 2, 3]'
```

## Taxonomy entry identifier

`Ibexa\Taxonomy\View\Matcher\TaxonomyEntryBased\Identifier` matches based on an identifier of the taxonomy entry.

```
match:
    '@Ibexa\Taxonomy\View\Matcher\TaxonomyEntryBased\Identifier': ['spring', 'events', 'devices']
```

## Taxonomy entry level

`Ibexa\Taxonomy\View\Matcher\TaxonomyEntryBased\Level` matches based on a level of the taxonomy entry. With this matcher, you can apply view rules based on a selection of taxonomy entry levels, by using the following logical operators: `<` , `>` , `<=`, `>=`, `=`.

```
match:
    '@@Ibexa\Taxonomy\View\Matcher\TaxonomyEntryBased\Level': '> 2'
```

## Taxonomy type

`Ibexa\Taxonomy\View\Matcher\TaxonomyEntryBased\Taxonomy` matches based on a type of taxonomy that the taxonomy entry belongs to.

```
match:
    '@Ibexa\Taxonomy\View\Matcher\TaxonomyEntryBased\Taxonomy': 'product_category'
```
