> For the complete documentation index, see [llms.txt](https://devise.gitbook.io/cms/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devise.gitbook.io/cms/creating-content-with-devise/fields/field-configuration-and-defaults.md).

# Field Configuration and Defaults

## Defaults

By setting the default property you provide a value before one has been set (or if it has been set to null).

```
@section('component')
  <script>
    var component = {
      fields: {
        someImage: {
          type: 'image',
          label: 'The Image'
          default: {
            url: '/imgs/default/image-hero.jpg',
            alt: 'We should do this for SEO reasons Jim'
          }
        }
      }
    }
  </script>
@endsection
```

## Enabler

If you set the `enabler` property on a field it will add an "enabled" checkbox on the field editor and set it to false by default (Unless you set it's default to true as we do in this example)

```
@section('template')
  <div v-if="devise.someImage.enabled">
    <img :src="devise.someImage.url" :alt="devise.someImage.alt" class="w-full">
  </div>
@endsection

@section('component')
  <script>
    var component = {
      fields: {
        someImage: {
          type: 'image',
          label: 'The Image',
          enabler: true,
          default: {
            enabled: true
          }
        }
      }
    }
  </script>
@endsection
```

## Instructions

Instructions give a little context to your content manager. It can also serve as some good sudo-documentation at times when you need to remember that image size you cut 3 months ago.

```
@section('component')
  <script>
    var component = {
      fields: {
        someImage: {
          type: 'image',
          label: 'The Image',
          instructions: 'Ensure this image is suitable for a white background'
        }
      }
    }
  </script>
@endsection
```

## Editor Label

On the editor sidebar it's not very helpful when you see a huge list of slices, often which repeat. To help the user understand where they are it's helpful to provide an `editorLabel` property to the field that you feel best represents the slice when it's populated. Devise uses the slice name until that field is populated and then replaces it with the contents of that field when the user hydrates that instance. Title fields and even images can serve as great editor labels.

```
@section('component')
  <script>
    var component = {
      fields: {
        someImage: {
          type: 'text',
          label: 'Title',
          editorLabel: true
        }
      }
    }
  </script>
@endsection
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://devise.gitbook.io/cms/creating-content-with-devise/fields/field-configuration-and-defaults.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
