Skip to content

Banner structure

Use the structure.json file to define the banner structure. This file includes the banners array where each banner is an object defined by an ID.

For example, a structure.json file with two banners, skyscraper and half-banner:

json
{
  "banners": [
    {
      "id": "skyscraper",
      "name": "Skyscraper",
      "size": {
        "width": 120,
        "height": 600,
        "dpr": 1
      },
      "thumbnail": "banners/skyscraper/media/images/thumb.jpg",
      "template": "banners/skyscraper/index.vue"
    },
    {
      "id": "half-banner",
      "name": "Half banner",
      "size": {
        "width": 234,
        "height": 60,
        "dpr": 1
      },
      "thumbnail": "banners/half-banner/media/images/thumb.jpg",
      "template": "banners/half-banner/index.vue"
    }
  ]
}

Each banner object includes the following fields:

     Field     TypeDescription
id*StringThe banner size identifier.
name*StringThe user-friendly name for the size displayed in the eWizard platform.
optimizeAssetsBoolean | ObjectTurns on/off all banner optimizations.
optimizeAssets.fontsBooleanWe recommend using Google Fonts as a priority. If local fonts are present, they're automatically converted to WOFF2 format during export.
optimizeAssets.imagesBooleanImages are compressed to 2x their rendered resolution (without exceeding the original dimensions) and converted to a web-optimized quality level.
optimizeAssets.removeUnusedBooleanUnused fonts, images, and videos are automatically removed from the final banner archive to minimize file size.
optimizeAssets.videosBooleanVideos are transcoded to MP4 format and scaled to their rendered resolution (up to the original size), with quality settings adjusted for web performance.
size*ObjectThe banner size dimensions.
size.width*NumberThe banner width in pixels.
size.height*NumberThe banner height in pixels.
size.dpr*NumberThe device pixel ratio for the given banner template size.
thumbnailStringA path to the banner size thumbnail. If the path isn't defined, eWizard determines the path based on the banner id in the default banners directory. For example, banners/skyskraper/media/thumbnail.png.
templateStringA path to the banner template of the required size. If the path isn't defined, eWizard determines the path based on the banner id in the default banners directory. For example, banners/skyscraper/index.vue.

The fields marked with asterisks (*) are required.

Plugin

You can access the list of banners and their settings using the structure plugin in the banner files of your banner project.

The banner structure plugin includes the getBanners method. Use this method to get nested data of all banners.

js
this.$structure.getBanners()