×

Error message

  • Warning: array_merge(): Argument #2 is not an array in superfish_block_view() (line 924 of /var/www/rhizome/data/www/developers.contentglass.com/drupal/sites/all/modules/superfish/superfish.module).
  • Warning: array_merge(): Argument #1 is not an array in superfish_block_view() (line 1035 of /var/www/rhizome/data/www/developers.contentglass.com/drupal/sites/all/modules/superfish/superfish.module).

Creating the manifest

The manifest is a file which tell Content Glass API to load your library and widgets.
Each manifest file start with the declaration of the manifest object under window object:


    window. SampleManifest= {
 //Manifest content
};

You can give your manifest every name you want but a good convention is {name}Manifest.
This are the fields the manifest needs to have:

Field name Type Description
contentglass_manifest Boolean Must have a value of true, otherwise Content Glass API will not recognize this manifest
author String The name of the author of this manifest.
provider_url String Url to the author site.
account_id String Your developer Id gotten when registered as a Content Glass developer.
document_root String This base value will be used for all the file loading of your widgets and libraries, in most case it will be your Content Glass project root dir path.
scripts Object Object that contain all the scripts needed, the library scripts and widgets scripts. In the future may contain more options. Divided into two parts and each part contain log (true/false), js(array of scripts paths), css(array of css paths). Dev part is for development mode and prod is for production mode.
widget_libraries Array contain Content Glass library definitions. Each definition is an object with the fields: id – string with the machine id, name – String that will be displayed to the user, constructor – the library constructor, index – an Int that say at which index you want the library be (if index is taken then will find the next one that is free), version – the version of the library , account_id– your developer ID.
view_libraries Array (optional) Contains all the views libraries objects, view libs are the same object structure as widgets libs.
layers Array (optional) Can contain new layer defenitions.

Here is a full manifest code:


    window.SampleManifest = { 
  contentglass_manifest: true,
  author: "Conetent Glass",
  account_id: "{YOUR-DEVELOPER-ID}",
  provider_url: "http://www.contentglass.com",
  document_root: "http://api.contentglass.com/templates/libraries/sample",
  scripts: {
   dev: {
    log: false,
    js: [
     {src:"/greeting/greetingWidget/GreetingWidget.js"},
     {src:"/greeting/SampleWidgetLibrary.js"}
    ],
   css: []
   },
   prod: {
    log: false,
    js: [
     {src:"/greeting/greetingWidget/GreetingWidget.js"},
     {src:"/greeting/SampleWidgetLibrary.js"}
    ],
    css: []
   }
  },
  widget_libraries: [
   {
    id: "sample-lib",
    name: "Sample",
    constructor: "cg.SampleWidgetLibrary",
    index: 6,
    version: "1.0",
    account_id: "{YOUR-DEVELOPER-ID}"
  }
  ],
  view_libraries:[],
  layers:[]
};

Now that we have a manifest the last step is to add a Meta tag in your site or
tell others to add the meta tag to their site and Content Glass system will load your libraries and widgets.