Creating a Module

Last updated on June 26, 2024.

This guide discusses how to create a module on Insites.

Prerequisites

To follow this tutorial, you must understand basic Insites concepts, the prescribed development workflow, and Modules:

Steps

Creating a module is a three-step process:

  • Step 1: Creating directories
  • Step 2: Creating GraphQL queries
  • Step 3: Creating a page

Step 1: Creating directories

Create two directories inside the directory called , then create the and folders. Place the directory inside and the directories inside .

This is the structural overview of the module you'll create:

Step 2: Creating GraphQL queries

Create a GraphQL query that pulls a list of Records.

modules/admincms/private/graphql/get_records.graphql

Create another GraphQL query that pulls a list of pages

modules/admincms/private/graphql/get_pages.graphql

Step 3: Creating a page

Create a page for your module:

modules/admincms/public/views/pages/admin.liquid

Use the queries as usual, but prefix the name with the module name.

The only difference between this code and the code of a regular Instance is that this module code is split
into public and private folders, and if you'd pull the code when it's installed on an Instance,
you would get a structure like this:

Related Topics

Please visit the following links for more information on Modules:

Have a suggestion for this page?

Didn't quite find what you are looking for or have feedback on how we can make the content better then we would love to hear from you. Please provide us feedback and we will get back to you shortly.