# Taxonomy select

Taxonomy select field renders a searchable [Select 2](https://select2.github.io/) field. Similar to the [Datalist](https://docs.alchemy-options.com/fields/datalist) field. Supports [multiple choice](#multiple-choice).

## Example configuration

```php
...
array(
    'title' => 'My taxonomy select field title',
    'id' => 'taxonomy-select-option',
    'desc' => 'Short description for the field',
    'tab' => 'main',
    'taxonomy' => 'category',
    'type' => 'taxonomy-select',
),
...
```

This will produce the following

![](https://2294767099-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKMTiOPVR7pXWhebz7q%2F-LKMTkyQru4k2zJzTpdQ%2F-LKMTqQULedYFy_J7E5k%2Ftaxonomy-select-one.png?generation=1534771033883164\&alt=media)

## Multiple choice

if `'multiple' => true` is added to the [configuration object](#example-configuration), the field will respect it. The following configuration

```php
...
array(
    'title' => 'My taxonomy select field title',
    'id' => 'taxonomy-select-option',
    'desc' => 'Short description for the field',
    'tab' => 'main',
    'taxonomy' => 'category',
    'multiple' => true,
    'type' => 'taxonomy-select',
),
...
```

will result in the following

![](https://2294767099-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LKMTiOPVR7pXWhebz7q%2F-LKMTkyQru4k2zJzTpdQ%2F-LKMTqQWWoZLkyKjsJGy%2Ftaxonomy-select-two.png?generation=1534771031007464\&alt=media)

## Params

| Name       | Type    | Description                                                                                                  |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------ |
| `type`     | string  | `taxonomy-select` **(required)**                                                                             |
| `id`       | string  | Unique ID that will be used to retrieve the value **(required)**                                             |
| `tab`      | string  | Specifies in which tab this option will be rendered                                                          |
| `title`    | string  | Shows a heading to the left of the field                                                                     |
| `desc`     | string  | Shows a description text (can have HTML)                                                                     |
| `multiple` | boolean | Set to `true` if multiple values are needed. See [an example](#multiple-choice) above.                       |
| `taxonomy` | string  | Taxonomy (standard or custom) to search the terms in. If not specified, searches in the `category` taxonomy. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.alchemy-options.com/fields/taxonomy-select.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
