Skip to content

Home

Introduction

Development

IDEs

Services

API Explorer

Releases

Release notes

Martini Runtime

Martini Desktop

Martini Online

Feature requests

Bug reports

Using resources in a Gloop template

A Gloop template can use resources like CSS or JS files. Such files can be stored externally (on a CDN for example) or internally using a Martini package's web directory.

To create a resource file in the web directory:

  1. Right click the web directory of your Martini package.
  2. From the appearing context menu, select New > File.
  3. Enter the name of your resource file.
  4. Click Finish.

Drag and drop to import resources

You can drag and drop files and folders into a Martini package's web directory to trigger an import.

Dragging and dropping resources

Dragging and dropping resources

To use a resource in your Gloop template, you must use the appropriate HTML tag (like <link> or <script>), and indicate the resource's location using the format /<package>/<resource>.

Consider the following example:

1
2
3
4
5
6
example
├── code
│   └── Index.gtpl
└── web
    ├── script.js
    └── style.css

To use script.js and style.css in Index.gtpl, you would need the following steps in Index.gtpl:

Gloop resource usage