Application types

Applications have 4 types

Full (default)

Standalone application, selected by default when creating a new application

Bundle

A listing of several applications that do not need to be connected with each-other. Serves as a bundle to install or update several applications in one go.

Module

Note

As of version 1.319.0 the new module v2 features are released. Read about its functionality here: Read more about module v2

Extension to a specific full application. Files in the module can be set as replacements for files in the target full application.

Modules will be installed when the full app is installed automatically but the replacements will not be enabled until the user uses the configure modules functionality to enable it.

There is no limit to how many modules can be enabled at the same time, but only a single module can be active if multiple of them target the same file in the full application. Goerp will generate the module configuration groups based on this - modules that target unique files will be in a separate group and modules that target the same files will be in the same group.

Asset

Applications that can be shared between multiple applications.

Used to share styles, js functions or general purpose partials/pages.

Note that the version of the asset in the application indicates the minimum required version of the asset, installation will make sure that at-least this version is installed. It will not downgrade the version on the account if it has a higher version installed.

Asset package creator needs to make sure that updates to the app does not break used elements in previous versions, if this cannot be done then a new application should be created instead.

Subsections of Application types

Modules

Modules V2

Module v2 features released as of version 1.319.0

Modules can be used to easily enable or disable certain features on existing applications with a toggle.

Connections to applications

Modules can be created for any application. V2 modules do not need to be added to the parent application, instead it is connected to the applications from the module application itself.

  1. Create of open a module type application in the development mode editor view
  2. Move to the ‘Modules’ tab
  3. Use the ‘Select application for module’ button to connect the module to needed application

The enable and disable checkbox here can be used to immediately enable the module.

By default, goerp does not limit the modules to groups like v1 modules did, but the following grouping can be used to create a custom behaviour similar to it. The custom group name field can be used to group modules to a custom radio group on the store and on the parent applications configure modules area.

Automatically merged data

Note that if the module contains translations or variables then these are automatically merged to the applications data when the module is enabled.

Modification type templates

With modules v2 the main file type for adjustments is the new type ‘modification’. By itself it does nothing. We need to configure it to alter something on a source page.

Multiple modifications can alter the same source (no defined limit).

  1. Create or edit a ‘modification’ type template in the module application.
  2. Open ‘Modules’ tab in the editor for the template.

You will see several options:

For template - Select the target template we want to alter

Module type - Select the module behaviour

  1. Replace all content - replaces all contents of the target
  2. Prepend all content - adds the module template contents before the target content
  3. Append all content - adds the module template contents after the target content
  4. Anchor - looks for the value in the ‘Module tag’ field and adds the content instead of it
  5. Replace by name - looks for the ‘Module tag’ html node and replaces its contents
  6. Prepend by name - looks for the ‘Module tag’ html node and adds content before its content
  7. Append by name - looks for the ‘Module tag’ html node and adds content after its content
  8. Prepend by ID - looks for the specific html node by its id and adds content before its content

Configure modules

Use the configure v2 modules button on the parent application ‘Modules’ tab or in the editor application structure view to enable and disable the modules.

In store

Note that v2 modules are not installed automatically from the store with the parent. Instead, the store will list all available modules from the store to the user, and the user can decide what to install.

However, the application type ‘bundle’ can be used to package the parent and modules into a single installation.

Examples

Adding new file dependencies to the source

Here we add an extra static css dependency to the original, adding a new line to the head of the document.

Parent index-page

<!DOCTYPE html>
<html>
    <head>
        <title>Demo modidied app</title>
        <link rel="stylesheet" {{ .Tools.CSP }} href="{{ .Tools.StaticLink "dma-styles-css" }}">
    </head>
    <body>
        <h1>Demo modified application</h1>

        {{ $products := .Tools.Func "dma-fetch-products-func" }}

        <div>
        {{ range $products.Array }}
            <div class="block">
                <p>{{ .Get "productID" }}</p>
                {{/* anchor */}}
            </div>
        {{ end }}
        </div>
    </body>
</html>

Modification template in module

For-template: index-page Module type: Append by name Module tag: head

<link rel="stylesheet" {{ .Tools.CSP }} href="{{ .Tools.StaticLink "dam3-styles-css" }}">

Replacing a custom anchor in the source

Here we use the anchor to just replace it in the source. Note that the anchor can be any value in the source.

Parent index-page

<!DOCTYPE html>
<html>
    <head>
        <title>Demo modidied app</title>
        <link rel="stylesheet" {{ .Tools.CSP }} href="{{ .Tools.StaticLink "dma-styles-css" }}">
    </head>
    <body>
        <h1>Demo modified application</h1>

        {{ $products := .Tools.Func "dma-fetch-products-func" }}

        <div>
        {{ range $products.Array }}
            <div class="block">
                <p>{{ .Get "productID" }}</p>
                {{/* anchor */}}
            </div>
        {{ end }}
        </div>
    </body>
</html>

Modification template in module

For-template: index-page Module type: Anchor Module tag: {{/* anchor */}}

<p>{{ .Get "code" }}</p>