+

Search Tips   |   Advanced Search

Registering theme-specific contributions


Add JSON configurations to the contributions folder within a theme. The contributions folder is the default folder. The location can be changed using metadata on the theme, as in the case of profiles. These files are automatically scanned by the system and the contributions defined are registered for the theme that defines them.

  1. Adapt the structure, keys, and values used in the plugin.xml file to match the JSON format.

    1. Keys that allow for multiple entries on the same level are used in the plural form by appending a lowercase (s).

    2. The file path starts with a forward slash (/that is resolved relative to the theme root folder.

  2. Define the path in the theme metadata, com.ibm.portal.theme.template.ref.

The following code is a sample of a JSON configuration.

{
   "modules":[{
  
      "id":"testModuleJson",   "version":"1.0",   "capabilitys":[{
                          "id":"my-js-lib", "value":"1.6.2"
                      }, {
                          "id":"some-other-js-lib", "value":"1.8"
                      }
              ]
      "contributions":[{
              "type":"head",           
              "sub-contributions":[{
                      "type":"js", "uris":[{
                              "value":""
                          }, {
                              "value":"/js/code.js.uncompressed.js", "type":"debug"
                          }]
                  }]
  
              }]
  },  {
  
              "id":"testModuleJson2", "version":"1.0",   "contributions":[{
  
              "type":"head", "sub-contributions":[{
                      "type":"js", "uris":[{
                              "value":"/js/code2.js"
                          }, {
                              "value":"/js/code2.js.uncompressed.js", "type":"debug"
                          }]
                        }]
      }]
  
  },  {
              "id":"testModuleJson3", "version":"1.0", "contributions":[{
              "type":"config",   
              "sub-contributions":[{
                      "type":"js", "uris":[{
                              "value":"/js/code3.js"
                          }, {
                              "value":"/js/code.js,uncompressed.js", "type":"debug"
                          }]
          }]
      
       }]
  
      }]
 }
 


Parent: Registering theme modules