Intlayer Content Management System (CMS) Documentation

    The Intlayer CMS is am Application that allows you to externalize your content of an Intlayer project.

    For that, Intlayer introduce the concept of 'distant dictionaries'.

    Intlayer CMS Interface

    Understanding distant dictionaries

    Intlayer make a difference between 'local' and 'distant' dictionaries.

    • A 'local' dictionary is a dictionary that is declared in your Intlayer project. Such as the declaration file of a button, or your navigation bar. Externalizing your content do not make sense in this case because this content is not supposed to change often.

    • A 'distant' dictionary is a dictionary that is managed through the Intlayer CMS. It could be useful to allow your team to manage your content in direct on your website, and also aims to use A/B testing features and SEO automatic optimization.

    Visual editor vs CMS

    The Intlayer Visual editor is a tool that allows you to manage your content in a visual editor for local dictionaries. Once a change is made, the content will be replaced in the code-base. That means that the application will be rebuilt and the page will be reloaded to display the new content.

    In contrast, the Intlayer CMS is a tool that allows you to manage your content in a visual editor for distant dictionaries. Once a change is made, the content will not impact your code-base. And the website will automatically display the changed content.

    Integrating

    For more details on how to install the package, see the relevant section below:

    Integrating with Next.js

    For integration with Next.js, refer to the setup guide.

    Integrating with Create React App

    For integration with Create React App, refer to the setup guide.

    Integrating with Vite + React

    For integration with Vite + React, refer to the setup guide.

    Configuration

    In your Intlayer configuration file, you can customize the CMS settings:

    intlayer.config.ts
    import type { IntlayerConfig } from "intlayer";const config: IntlayerConfig = {  // ... other configuration settings  editor: {    /**     * Required     *     * The URL of the application.     * This is the URL targeted by the visual editor.     */    applicationURL: process.env.INTLAYER_APPLICATION_URL,    /**     * Required     *     * Client ID and client secret are required to enable the editor.     * They allow the identify the user who is editing the content.     * They can be obtained by creating a new client in the Intlayer Dashboard - Projects (/dashboard/projects).     * clientId: process.env.INTLAYER_CLIENT_ID,     * clientSecret: process.env.INTLAYER_CLIENT_SECRET,     */    clientId: process.env.INTLAYER_CLIENT_ID,    clientSecret: process.env.INTLAYER_CLIENT_SECRET,    /**     * Optional     *     * In the case you are self-hosting the Intlayer CMS, you can set the URL of the CMS.     *     * The URL of the Intlayer CMS.     * By default, it is set to https://intlayer.org     */    cmsURL: process.env.INTLAYER_CMS_URL,    /**     * Optional     *     * In the case you are self-hosting the Intlayer CMS, you can set the URL of the backend.     *     * The URL of the Intlayer CMS.     * By default, it is set to https://back.intlayer.org     */    backendURL: process.env.INTLAYER_BACKEND_URL,  },};export default config;

    If you don't have a client ID and client secret, you can obtain them by creating a new client in the Intlayer Dashboard - Projects.

    To see all available parameters, refer to the configuration documentation.

    Using the CMS

    Push your configuration

    To configure the Intlayer CMS, you can use the intlayer CLI commands.

    bash
    npx intlayer config push

    If you use environment variables in your intlayer.config.ts configuration file, you can specify the desired environment using the --env argument:

    bash
    npx intlayer config push --env production

    This command uploads your configuration to the Intlayer CMS.

    Push a dictionary

    To transform your locale dictionaries in a distant dictionary, you can use the intlayer CLI commands.

    bash
    npx intlayer dictionary push -d my-first-dictionary-key

    If you use environment variables in your intlayer.config.ts configuration file, you can specify the desired environment using the --env argument:

    bash
    npx intlayer dictionary push -d my-first-dictionary-key --env production

    This command uploads your initial content dictionaries, making them available for asynchronous fetching and editing through the Intlayer platform.

    Edit the dictionary

    Then you will be able to see and manage your dictionary in the Intlayer CMS.

    Debug

    If you encounter any issues with the CMS, check the following:

    • The application is running.

    • The editor configuration are correctly set in your Intlayer configuration file.

      • Required fields:
        • The application URL should match the one you set in the editor configuration (applicationURL).
        • The CMS URL
    • Ensure that the project configuration was pushed to the Intlayer CMS.

    • The visual editor use an iframe to display your website. Ensure that the Content Security Policy (CSP) of your website allows your application url as frame-ancestors. Check the editor console for any error.

    If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.

    GitHub link to the documentation