Login

Recover Your Password

Return to Product Support > Learning Center > Developer References > Creating Add-ons > Add-on Collections > Collection Installation File > Collection File Resource Node

Collection File Resource Node

A resource is a file that the collection uses, and needs to be installed on the server or site. There can be many resource nodes.

<Resource name="" type="www|content|execute" path="">

Name is the filename of the resource. If it is just a filename with no path, the file should be included with the installation. If the filename includes a path, this is considered the source path, and these paths must be included in the zipped installation file. For instance, if the resource name = "\images\happy.png", then when the installation file is created, there must be a \images\ folder created in the zip file.

Type can be either of three values

  • www is a file that will be installed to the websites root folder, in the path specified by the path attribute
  • content types will be installed in the content files, in teh path specified by the path attribute
  • execute types will be installed in the Contensive Add-on folder

Path are the subfolders within the area that the resource will be installed. If Path is blank, files will be installed in the folder structure as the source.

Example 1

For instance, to add an image "/images/pic.png" to the site, include "pic.png" as a resource file in addition to the collection file, and add a resource node to the collection:

<resource name="pic.png" type="www" path="images">

You may then zip together the collection file and the pic.png into a single collection.zip file and upload that.

Example 2

To include a javascript file called my.js in the root of your website, include the my.js as a resource file, and add a resource node to the collection file:

<resource name="my.js" type="www">

and again, you can zip it into a single distributable zip file.

Example 3

To include a stylesheet file called main.css in the 'styles' folder of your website, you could create a zip file which includes the "styles\main.css" folder and file in the zip file, then use the following resource node:

<resource name="\styles\main.css" type="www">

and again, you can zip it into a single distributable zip file.