Pro tips > How to manage a live and a preview site

    How to manage a live and a preview site

    As soon as you go live with a site you need to have a way to save and preview content before going live.

    To do that in DatoCMS you can enable the draft/published system on a per-model basis.

    Once you have created your new draft records you might want to preview them, but how? You can combine the draft/published system with the deployment environments to achieve that.

    For example you can have your live site pulling content from the main GraphQL endpoint and instead your staging pulling your drafts from the preview endpoint.

    If you are using our REST API instead you can fetch the draft content using the version attribute, for example on the records.

    Finally you can leverage the deployment environments if you want to let your editors be able to manually trigger builds for the different sites.