Modules allow for code reuse and sharing while, at the same time, protecting the intellectual property (IP) of creators and developers.
In your codebase, the
You can split module code into two directories to protect IP (Intellectual Property). To create a module, split the module code into
In general, when referencing files that are part of a module, Insites uses a prefix that does not include any
You can create an Instance and deploy the code as you would usually do, and you still can have the
This mechanism allows creators to share their module code and make it configurable (by code in the
An example of module code split into two directories inside the
Configuration files placed in a module are treated differently than regular files.
A namespacing strategy is used to avoid conflicts between the code of a module and regular code (or between modules).
The general rule of accessing files in modules is to prefix paths with
When you use app:
Is accessed by path:
When you use module:
Is accessed by path:
The only difference is the prefix.
This section demonstrates the use of Modules for the following Insites elements:
You can access assets placed in the
Paths for those files are prefixed with
modules/admin/public/assets/app.css
modules/admin/public/assets/admin.js
Partials can be referenced with their shorter name - the same as the regular ones.
For example, to include partial saved as
Layout name has the same prefix when referenced within a page:
modules/admin/public/views/layouts/settings.liquid
modules/admin/private/records/resume.yml
modules/admin/public/authorization_policies/can_view_blog_posts
Within the page/form, it is referenced with a prefix:
GraphQL Query
The query looks like any other query:
But it is referenced with the prefix:
modules/admin/public/graphql/get_blog_instance.graphql
You should place the Translations YAML files for the module in:
But when used in the module code, they should be prefixed, such as in the example below:
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.