> For the complete documentation index, see [llms.txt](https://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://feathersjs-mongoose.gitbook.io/feathers-mongoose-casl/docs/guides/dashboard/service-configuration/doc-layout.md).

# doc Layout

Doc layout is array of field that help you to manage the layout of the fields in the document.

with doc layout you can add custom fields, fields with condition :<br>

### Render fields in the same Row

```
module.exports = function (app) {
  const Model = createModel(app);
  const paginate = app.get('paginate'); // Register validators to validate schema and to register dashboard screen;

  const options = {
    Model,
    paginate,
    serviceRules,
    dashboardConfig: {
      docLayout: 
      [
        '_id',
        ['firstName', 'lastName']
      ]
    }
  };

  // Initialize our service with any options it requires
  app.use('/invitations', new Invitations(options));

  // Get our initialized service so that we can register hooks
  const service = app.service('invitations');

  service.hooks(hooks);
};
```

### Render custom field - link type

```
docLayout: [
        {
          type: 'custom',
          customFieldType: 'link',
          style: 'button',
          linkTemplate: 'dashboard/floor-plan?floorId={{ _id }}',
          label: 'Plan',
          itemKey: 'linkToPlan',
          hideOnCreate: true,
          hideOnUpdate: false,
         }
]
```

### Render field with condition&#x20;

```
// equalTo
docLayout : [
  {
    when: {
      field: 'type',
      equalTo: OFFICES_TYPE.other,
      then: 'other_type'
    }
  }
]
// conditions (read sift query - https://github.com/crcn/sift.js/tree/master)
docLayout : [
  {
    when: {
      conditions: {tags: { $in: ["hello", "world"] }},
      then: 'other_type',
      otherwise: 'tags'
    }
  }
]
```

{% content-ref url="/pages/-Lt4F6y6889zUUvpl-xb" %}
[Broken mention](broken://pages/-Lt4F6y6889zUUvpl-xb)
{% endcontent-ref %}

{% content-ref url="/pages/-LtJIwa0vyIH36efmikq" %}
[customElements](/feathers-mongoose-casl/docs/guides/dashboard/service-configuration/custom-fields/customelements.md)
{% endcontent-ref %}
