## How to use a different layout in a page

By default all the pages you create use the default page layout in `gatsby-theme-core/src/components/Layouts/Page.js`.
This is great if you quickly want to start writing your page's content.

If you want to use another available layout in the theme (a layout with sidebar for example) you can easily do it also.
Here's how to use the layout with a sidebar in a page:

- create a new page, `foo.mdx` for example;
- add `frontmatter` metadata with at least `title` and `order` fields;
- add an additional `frontmatter` field named `layout` where the possible values are the available layouts in `gatsby-theme-core/src/components/Layouts/` folder (omit the `.js` extension);
- Since there are 2 content areas in this layout make sure to specify them both:
  ```
  <MainContent>This is your main content</MainContent>
  <Sidebar>This is your sidebar content</Sidebar>
  ```

## Full example

```
---
title: Home
order: 10
layout: PageWithSidebar
---

<MainContent>

  # This is the home page with a layout applied from MDX.

</MainContent>

<Sidebar>

  # This is the sidebar

</Sidebar>
```
